bumptech / bumptech/glide

Not loading images from HTTPS URLs on lower(!) Android versions but works fine on most recent versions

Open
#4,704 7 comments 3 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**Glide Version**:
4.11.0

**Integration libraries**:
No.

**Device/Android Version**:
Galaxy Nexus with API 23 Emulator through Android Studio.
Works fine on same emulator with currently (as of 2021) most recent Android versions.

**Issue details / Repro steps / Use case background**:
https://github.com/bumptech/glide/issues/1726
https://github.com/bumptech/glide/issues/4563

**Glide load line / `GlideModule` (if any) / list Adapter code (if any)**:
```kotlin
val glideListener = object : RequestListener {
override fun onLoadFailed(e: GlideException?, model: Any?, target: com.bumptech.glide.request.target.Target?, isFirstResource: Boolean): Boolean {
return true
}

override fun onResourceReady(resource: Drawable?, model: Any?, target: com.bumptech.glide.request.target.Target?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
return true
}
}
Glide
.with(binding.imgLogo.context)
.load(iconUrlFull)
.listener(glideListener)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.skipMemoryCache(true)
.apply(RequestOptions.circleCropTransform())
.into(binding.imgLogo)
```

**Stack trace / LogCat**:
https://github.com/bumptech/glide/issues/4563

____

I am trying to fetch website icons through URLs that are proven to work. When running Code A and fetching the icons through Glide on most recent Android API versions, all works as expected. However, if running the same exact Code A and doing precisely the same thing on lower Android API versions (for example API 23), then Glide fails with a trust anchor exception.

I am disappointed to see that it is recommended to use unsafe workarounds by making OkHttp disable certificate validation, etc., especially when forcing it upon 3rd party software maintainers, when this is undeniably a bug with Glide. The same implementation works in newer Android versions, but not older ones. So, instead of [recommending voodoo](https://github.com/bumptech/glide/issues/1726#issuecomment-279523308) or just [making it worse](https://stackoverflow.com/a/63740334/7061105), Glide should have this issue fixed, internally, in the best way possible.

P.S.: It's not a bug with Android, because I can fetch the same images on Android API 23 through Apache HTTP Client. So, clearly, this is fixable, without unsafe voodoo workarounds, that make the situation worse, instead of fixing it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.