I'm using the standard Glide library to load and display images in my Android app.
After switching my image domain's SSL certificate to “Sectigo Public Server Authentication CA DV R36”, image loading fails on Android 12 and below, while it works without issue on Android 13, 14, and 15.
The error I'm receiving on older versions is:
javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found
Glide.with(this)
.load(imageUrl)
.error(R.drawable.ic_person_black_24dp__1_)
.into(binding.contentDashboardLayout.profileImage)
My API requests are working fine because I'm using SSL pinning, where I dynamically fetch the SHA-256 public key and pin it correctly.
However, images loaded through Glide fail because Glide uses its own internal OkHttpClient, which doesn't include my custom SSL pinning configuration.
How can I fix the image loading issue in my Android app? Do I need to make changes at the project level (e.g., Glide configuration), or should I change the SSL certificate provider to ensure compatibility with all Android versions?