content: package my.project.sakuraproject.util;
  
  import javax.net.ssl.SSLContext;
  import javax.net.ssl.SSLSocketFactory;
  import javax.net.ssl.TrustManager;
  import javax.net.ssl.X509TrustManager;
  
  /**
   * 忽略Https验证
   * https://github.com/google/ExoPlayer/issues/6463
   */
  public class CropUtil {
  
      public static SSLSocketFactory getUnsafeSslSocketFactory() {
          try {
              final TrustManager[] trustAllCerts = new TrustManager[]{
                      new X509TrustManager() {
                          @Override
                          public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {
                          }
  
                          @Override
                          public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {
                          }
  
                          @Override
                          public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                              return new java.security.cert.X509Certificate[]{};
                          }
                      }
              };
  
              SSLContext sslContext = SSLContext.getInstance("SSL");
              sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
              return sslContext.getSocketFactory();
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
      }
  }
  