File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,17 @@ function getClient(
260260 reload : boolean = false ,
261261 timeout : number = 10
262262) : okhttp3 . OkHttpClient {
263+ if ( ! Client ) {
264+ // ssl error fix on KitKat. Only need to be done once.
265+ // client will be null only onced so will run only once
266+ const version = android . os . Build . VERSION . SDK_INT ;
267+ if ( version >= 16 && version < 22 ) {
268+ java . security . Security . insertProviderAt (
269+ ( org as any ) . conscrypt . Conscrypt . newProvider ( ) ,
270+ 1
271+ ) ;
272+ }
273+ }
263274 // if (!Client) {
264275 // Client = new okhttp3.OkHttpClient()
265276 // }
Original file line number Diff line number Diff line change 11dependencies {
22 def okHttpVersion = project. hasProperty(" okHttpVersion" ) ? project. okHttpVersion : " 3.14.7"
33 implementation " com.squareup.okhttp3:okhttp:$okHttpVersion "
4+ def conscryptVersion = project. hasProperty(" conscryptVersion" ) ? project. conscryptVersion : " 2.4.0"
5+ implementation " org.conscrypt:conscrypt-android:$conscryptVersion "
46}
You can’t perform that action at this time.
0 commit comments