Glide - javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:未找到认证路径的信任锚 [英] Glide - javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found
问题描述
我将服务器从 HTTP
迁移到 HTTPS
我已经使用自签名证书通过 HttpUrlConnection
发送网络请求并且它工作但对于图像加载它不起作用,因为我使用 Glide 进行图像加载.
I migrated the server from HTTP
to HTTPS
I have used self-signed certificate to send network requests with HttpUrlConnection
and it worked but for image loading it is not working as I have used Glide for Image loading.
javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:未找到证书路径的信任锚.通过滑行库从 https URL 加载图像
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 但它似乎不起作用.请帮忙.
I tried using this link and used GlideModule but it does not seem to work. Please help.
推荐答案
关于证书的问题 请点击此链接 -https://stackoverflow.com/a/39032433/4741746
The issue is about certificate follow this link -https://stackoverflow.com/a/39032433/4741746
这将绕过证书并允许您进入系统
This will bypass certificate and allow you to enter in system
另见此链接 -https://futurestud.io/tutorials/glide-module-example-accepting-self-signed-https-certificates
创建您的自定义 GlideModule 类、OkHttpUrlLoader 类并将 Glide 附加到您上面的链接中
Create your custom GlideModule Class,OkHttpUrlLoader class and attach to you Glide as mention in above link
你必须把
<meta-data
android:name="io.futurestud.tutorials.glide.glidemodule.CustomImageSizeGlideModule"
android:value="GlideModule" />
AndroidMainifyingt 文件的内部应用程序标签 https://github.com/fs-opensource/android-tutorials-glide/blob/master/app/src/main/AndroidManifest.xml
Inside application tag of your AndroidMainifiest file https://github.com/fs-opensource/android-tutorials-glide/blob/master/app/src/main/AndroidManifest.xml
这篇关于Glide - javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:未找到认证路径的信任锚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!