From 78e5c027a5f35475c72a69c077e7137c7a2a5f1a Mon Sep 17 00:00:00 2001 From: MohamadJaara Date: Mon, 11 Dec 2023 11:07:16 +0100 Subject: [PATCH] fix: cert pinning failing for GET:/api-version --- .../kotlin/com/wire/kalium/logic/featureFlags/KaliumConfigs.kt | 2 +- .../kotlin/com/wire/kalium/network/HttpEngine.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/featureFlags/KaliumConfigs.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/featureFlags/KaliumConfigs.kt index 4aea8d10954..d5e3e058c23 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/featureFlags/KaliumConfigs.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/featureFlags/KaliumConfigs.kt @@ -33,7 +33,7 @@ data class KaliumConfigs( val lowerKeyPackageLimits: Boolean = false, val lowerKeyingMaterialsUpdateThreshold: Boolean = false, val developmentApiEnabled: Boolean = false, - val ignoreSSLCertificatesForUnboundCalls: Boolean = true, + val ignoreSSLCertificatesForUnboundCalls: Boolean = false, val guestRoomLink: Boolean = true, val selfDeletingMessages: Boolean = true, val wipeOnCookieInvalid: Boolean = false, diff --git a/network/src/commonJvmAndroid/kotlin/com/wire/kalium/network/HttpEngine.kt b/network/src/commonJvmAndroid/kotlin/com/wire/kalium/network/HttpEngine.kt index be2ce3bd512..5a70809e1cb 100644 --- a/network/src/commonJvmAndroid/kotlin/com/wire/kalium/network/HttpEngine.kt +++ b/network/src/commonJvmAndroid/kotlin/com/wire/kalium/network/HttpEngine.kt @@ -65,7 +65,7 @@ actual fun defaultHttpEngine( certificatePinning: CertificatePinning ): HttpClientEngine = OkHttp.create { OkHttpSingleton.createNew { - if (certificatePinning.isNotEmpty()) { + if (certificatePinning.isNotEmpty() && !ignoreSSLCertificates) { val certPinner = CertificatePinner.Builder().apply { certificatePinning.forEach { (cert, hosts) -> hosts.forEach { host ->