1

Image not loading with Glide, after migrated the server from HTTP to HTTPS. But the images are loaded in Browser correctly.

Dependency:

implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'

Simple image load:

Glide.with(Context).load(imageUrl).into(imgView);

How can I overcome this??

2 Answers2

1

i think the server hosting the file (backend server) is not trusted by REST client (Retrofit). Short term solution to continue development is to trust all certificates but for Production environment you will have to trust exact certificate of your backend (hosting images), this is usually done by either bundling certifcate file or its fingerprint. Please refer here for sample implementations shared in other threads. Short term fix (for development) - https://stackoverflow.com/a/39032433/4741746 Similar thread - https://stackoverflow.com/a/41114813/1992013

Birender Singh
  • 513
  • 6
  • 16
0

The issue is about certificate. You need to create your custom GlideModule Class,OkHttpUrlLoader class and attach to you Glide as mention in the link below

https://futurestud.io/tutorials/glide-module-example-accepting-self-signed-https-certificates

Then you have to put the following in your manifest file

<meta-data
    android:name="io.futurestud.tutorials.glide.glidemodule.CustomImageSizeGlideModule"
    android:value="GlideModule" />

Check the example https://github.com/futurestudio/android-tutorials-glide/blob/master/app/src/main/AndroidManifest.xml

Zaartha
  • 1,106
  • 9
  • 25