UniversalImageLoader加载图片,路径带https报异常,哪里可以配置网络请求?

DavidWu 发布于 2014/09/17 14:23
阅读 5K+
收藏 0

UniversalImageLoader加载图片,路径带https报异常,哪里可以配置网络请求?


 java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
 javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
  at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:429)
  at com.android.okhttp.Connection.upgradeToTls(Connection.java:1014)
  at com.android.okhttp.Connection.connect(Connection.java:955)
  at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:405)
  at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:343)
  at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:289)
  at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
  at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:89)
  at com.android.okhttp.internal.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:161)
  at com.nostra13.universalimageloader.core.download.BaseImageDownloader.connectTo(BaseImageDownloader.java:126)
  at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStreamFromNetwork(BaseImageDownloader.java:110)
  at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStream(BaseImageDownloader.java:84)
  at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.downloadImage(LoadAndDisplayImageTask.java:340)
  at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryCacheImageOnDisc(LoadAndDisplayImageTask.java:307)
  at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryLoadBitmap(LoadAndDisplayImageTask.java:249)
  at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.run(LoadAndDisplayImageTask.java:131)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  at java.lang.Thread.run(Thread.java:811)
 Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
  at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:282)
  at com.android.org.conscrypt.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:202)
  at com.android.org.conscrypt.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:662)
  at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
  at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:425)
  ... 18 more
 Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
  ... 23 more
 java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

加载中
0
鸡腿加茄子
鸡腿加茄子
楼主你好,你的解决方案是什么呢?我现在也碰到这个问题,为什么同一个项目,在公司和家里运行出来效果就是不一样呢,是因为电脑的证书问题吗?
0
DavidWu
DavidWu

引用来自“鸡腿加茄子”的评论

楼主你好,你的解决方案是什么呢?我现在也碰到这个问题,为什么同一个项目,在公司和家里运行出来效果就是不一样呢,是因为电脑的证书问题吗?
Mason-Universal-image-loader-master
0
oldfeel
oldfeel
在调用 image url 的时候执行 url = url.replace("https://","http://");
返回顶部
顶部