1
0
mirror of https://github.com/etesync/android synced 2025-03-25 03:45:46 +00:00

HttpClient: use the http client builder when using etesync

If we don't use the http client builder we don't get cert4droid hooked
which means we won't correctly support self-signed certificates.
This commit is contained in:
Tom Hacohen 2020-09-07 18:43:06 +03:00
parent 048acdf26c
commit bf050aa53b
3 changed files with 3 additions and 3 deletions
app/src/main/java/com/etesync/syncadapter

View File

@ -68,7 +68,6 @@ class HttpClient private constructor(
) {
private var certManager: CustomCertManager? = null
private var certificateAlias: String? = null
private var cache: Cache? = null
private val orig = sharedClient.newBuilder()

View File

@ -69,7 +69,7 @@ open class ChangeEncryptionPasswordActivity : BaseActivity() {
}
doAsync {
val httpClient = HttpClient.sharedClient
val httpClient = HttpClient.Builder(this@ChangeEncryptionPasswordActivity).setForeground(true).build().okHttpClient
try {
Logger.log.info("Loging in with old password")

View File

@ -90,7 +90,8 @@ class AccountViewModel : ViewModel() {
doAsync {
val settings = AccountSettings(context, account)
val etebaseLocalCache = EtebaseLocalCache.getInstance(context, account.name)
val etebase = EtebaseLocalCache.getEtebase(context, HttpClient.sharedClient, settings)
val httpClient = HttpClient.Builder(context).setForeground(true).build().okHttpClient
val etebase = EtebaseLocalCache.getEtebase(context, httpClient, settings)
val colMgr = etebase.collectionManager
uiThread {
holder.value = AccountHolder(