android–Glide–javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorExcept

android–Glide–javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorExcept,第1张

概述我将服务器从HTTP迁移到HTTPS我已经使用自签名证书来发送带有HttpUrlConnection的网络请求并且它工作但是对于图像加载它不起作用,因为我使用Glide进行图像加载.javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:Trustanchorforcertifi

我将服务器从http迁移到httpS我已经使用自签名证书来发送带有httpUrlConnection的网络请求并且它工作但是对于图像加载它不起作用,因为我使用GlIDe进行图像加载.

javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValIDatorException: Trust anchor for certification path not found.while loading images from https URL through glIDe library

GlIDe.with(mContext).load(currentItem.getimage_path().replace(" ", "%20"))     .Listener(new RequestListener<String, GlIDeDrawable>() {        @OverrIDe        public boolean onException(Exception e, String model, Target<GlIDeDrawable> target, boolean isFirstResource) {            genericVIEwHolder.imageVIEw_1.setimageResource(R.drawable.image_thumbnail);            genericVIEwHolder.progressbar.setVisibility(VIEw.GONE);            return false;        }        @OverrIDe        public boolean onResourceReady(GlIDeDrawable resource, String model, Target<GlIDeDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {            genericVIEwHolder.progressbar.setVisibility(VIEw.GONE);            return false;        }    }).into(genericVIEwHolder.imageVIEw_1);

我尝试使用this链接并使用GlIDeModule但它似乎不起作用.请帮忙.

解决方法:

问题是关于证书请按照此链接-https://stackoverflow.com/a/39032433/4741746

这将绕过证书并允许您进入系统

看到这个链接也是-https://futurestud.io/tutorials/glide-module-example-accepting-self-signed-https-certificates

创建您的自定义GlIDeModule类,OkhttpUrlLoader类并附上GlIDe,如上所述

你必须把

<Meta-data        androID:name="io.futurestud.tutorials.glIDe.glIDemodule.CustomImageSizeGlIDeModule"        androID:value="GlIDeModule" />

AndroIDMainifIEst文件https://github.com/fs-opensource/android-tutorials-glide/blob/master/app/src/main/AndroidManifest.xml的内部应用程序标记

总结

以上是内存溢出为你收集整理的android – Glide – javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorExcept全部内容,希望文章能够帮你解决android – Glide – javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorExcept所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1101205.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存