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: 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);
I tried using this link and used GlideModule but it does not seem to work. Please help.
Trust anchor for certification path not found. That error is usually due to a misconfigured certificate or a misconfiguration with the webserver config files as it relates to certificates…
Indicates that the client and server could not negotiate the desired level of security. The connection is no longer usable.
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
see this link also -https://futurestud.io/tutorials/glide-module-example-accepting-self-signed-https-certificates
Create your custom GlideModule Class,OkHttpUrlLoader class and attach to you Glide as mention in above link
You have to put
<meta-data
android:name="io.futurestud.tutorials.glide.glidemodule.CustomImageSizeGlideModule"
android:value="GlideModule" />
Inside application tag of your AndroidMainifiest file https://github.com/fs-opensource/android-tutorials-glide/blob/master/app/src/main/AndroidManifest.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With