@@ -6,6 +6,7 @@ package at.bitfire.icsdroid
66
77import android.content.Context
88import at.bitfire.cert4android.CustomCertManager
9+ import at.bitfire.cert4android.CustomCertStore
910import at.bitfire.icsdroid.ui.ForegroundTracker
1011import dagger.assisted.Assisted
1112import dagger.assisted.AssistedFactory
@@ -16,6 +17,7 @@ import io.ktor.client.engine.HttpClientEngine
1617import io.ktor.client.engine.okhttp.OkHttp
1718import io.ktor.client.plugins.HttpTimeout
1819import io.ktor.client.plugins.UserAgent
20+ import io.ktor.client.plugins.cookies.HttpCookies
1921import okhttp3.brotli.BrotliInterceptor
2022import okhttp3.internal.tls.OkHostnameVerifier
2123import javax.net.ssl.SSLContext
@@ -57,7 +59,8 @@ class AppHttpClient @AssistedInject constructor(
5759 // CustomCertManager is Closeable, but HttpClient will live as long as the application is in memory,
5860 // so we don't need to close it
5961 private val certManager = CustomCertManager (
60- context = context,
62+ certStore = CustomCertStore .getInstance(context),
63+ trustSystemCerts = true ,
6164 appInForeground = ForegroundTracker .inForeground
6265 )
6366
@@ -79,6 +82,9 @@ class AppHttpClient @AssistedInject constructor(
7982 socketTimeoutMillis = 60_000
8083 }
8184
85+ // Enable cookie storage - in memory, will be lost on app restart
86+ install(HttpCookies )
87+
8288 // Disable redirect following, it's handled by CalendarFetcher
8389 followRedirects = false
8490 }
0 commit comments