Native Shopify Mobile App with 20 new features
Kickstart your hyperlocal marketplace in Corona pandemic with a starter guide
Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 126.96.36.199 release ready!
Owner and Founder. Opencart
This blog focus on Retrofit handle the SSLHandshakeException.
Using Retrofit as your network library is a very good option for android app development. But many a time we face the SSLHandshakeException (java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.) to be particular.
This error means that the secure url you are making request to is not allowing your Retrofit to connect and fetch data.
If you can manage to change the usage from https to http then this will work perfectly fine and you don’t need to actually change anything.
But, if you can’t then you need to modify your retrofit Request builder object ( OkHttpClient.Builder to be particular) so that your application can fetch the data and the exception mentioned in the title is not a hurdle anymore.
You need to modify your OkHttpClient.Builder object in your Retrofit request so that your request can actually create a certificate that can be trusted by your server and your server can allow the access to your request.
Modified OkHttpClient.Builder Object.
using this object in your retrofit request.
Keep coding and Keep Sharing.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
It is good to hear that our blog helped you.
It means a lot.
But we don’t accept donations for technical blogs.
These blogs are one of the efforts from our side to make the mobile development community better.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.