滑行-javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:找不到证书路径的信任锚 [英] Glide - javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found

查看:1908
本文介绍了滑行-javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:找不到证书路径的信任锚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将服务器从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 加载图像时

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);

我尝试使用链接和使用了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" />

您的AndroidMainifiedt文件的内部应用程序标记

Inside application tag of your AndroidMainifiest file https://github.com/fs-opensource/android-tutorials-glide/blob/master/app/src/main/AndroidManifest.xml

这篇关于滑行-javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:找不到证书路径的信任锚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆