Wednesday, August 23, 2017

Android Adding File Certificate To Retrofit 2.0+



After the previous post about how to adding file certificate to Retrofit 1.7, today i gonna share a new tutorial about how to adding file certificate to Retrofit 2.0.


As you know, one of usage of file certificate is used to access HTTPS from HTTP. If your current host is HTTPS but you still access using HTTP , so by using file certificate it will be redirecting to HTTPS automatically.

Before you adding file certificate to Retrofit 2.0 make you using OKHTTP 3 for your client. So here is the method that you can use for adding file certificate to Retrofit 2.0 :

First import the following package :

Here the method that i use in my project, write the following method (you can modify the method as you wish) :

That's all, hope it helps and works. Thank you.

Related Posts

2 komentar

i tried with the code but it gives me that host name verifier

JW Marriott Philadelphia Casino - Mandir
Visit JW Marriott 오산 출장샵 Philadelphia Casino and 충청북도 출장마사지 enjoy the latest hotel deals 성남 출장안마 on 문경 출장마사지 Mandir, a Philadelphia 용인 출장안마 hotel, spa, golf and more at JW Marriott Philadelphia.


EmoticonEmoticon