for calling my web APIs, Im using retrofit and custom SSL configuration
inline fun <reified T> createWebService(): T { val customTrust = CustomTrust() var client = OkHttpClient.Builder().build() try { client = OkHttpClient.Builder() .sslSocketFactory(customTrust.getSocketFactory(),customTrust.getTrustManager()) .build() Log.i("Security","Ssl initialized") }catch (e: GeneralSecurityException){ Log.e("Security","unable to init ssl") } val gson = GsonBuilder() .setLenient() .create() val retrofit = Retrofit.Builder() .baseUrl(baseUrl) .client(client) .addConverterFactory(GsonConverterFactory.create(gson)) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()).build() return retrofit.create(T::class.java) }
Hi, thank you for this amazing library.
I was wondering if this library supports custom SSL connection to observe internet connectivity!
when I want to check the connection with the base URL, https://bluhbluh.bluh it gives me the handshake error...
for calling my web APIs, Im using retrofit and custom SSL configuration
inline fun <reified T> createWebService(): T { val customTrust = CustomTrust() var client = OkHttpClient.Builder().build() try { client = OkHttpClient.Builder() .sslSocketFactory(customTrust.getSocketFactory(),customTrust.getTrustManager()) .build() Log.i("Security","Ssl initialized") }catch (e: GeneralSecurityException){ Log.e("Security","unable to init ssl") } val gson = GsonBuilder() .setLenient() .create() val retrofit = Retrofit.Builder() .baseUrl(baseUrl) .client(client) .addConverterFactory(GsonConverterFactory.create(gson)) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()).build() return retrofit.create(T::class.java) }