]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/viewmodels/WebViewSource.kt
Allow View Source to connect to untrusted SSL certificates. https://redmine.stoutner...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / viewmodels / WebViewSource.kt
index 1b9d9e1203dd15399c1efba4f05e5e6337115c13..3251d92048038fe6cc9f90d75ad85454741dfd26 100644 (file)
@@ -43,7 +43,8 @@ class WebViewSource(private val urlString: String, private val userAgent: String
         val getSourceBackgroundTask = GetSourceBackgroundTask()
 
         // Get the source.
-        executorService.execute { mutableLiveDataSourceStringArray.postValue(getSourceBackgroundTask.acquire(urlString, userAgent, localeString, proxy, contentResolver, this)) }
+        executorService.execute { mutableLiveDataSourceStringArray.postValue(getSourceBackgroundTask.acquire(urlString, userAgent, localeString, proxy, contentResolver, this,
+            false)) }
     }
 
     // The source observer.
@@ -65,7 +66,7 @@ class WebViewSource(private val urlString: String, private val userAgent: String
     }
 
     // The workhorse that gets the source.
-    fun updateSource(urlString: String) {
+    fun updateSource(urlString: String, ignoreSslErrors: Boolean) {
         // Reset the mutable live data error string.  This prevents the snackbar from displaying later if the activity restarts.
         mutableLiveDataErrorString.postValue("")
 
@@ -73,6 +74,7 @@ class WebViewSource(private val urlString: String, private val userAgent: String
         val getSourceBackgroundTask = GetSourceBackgroundTask()
 
         // Get the source.
-        executorService.execute { mutableLiveDataSourceStringArray.postValue(getSourceBackgroundTask.acquire(urlString, userAgent, localeString, proxy, contentResolver, this)) }
+        executorService.execute { mutableLiveDataSourceStringArray.postValue(getSourceBackgroundTask.acquire(urlString, userAgent, localeString, proxy, contentResolver, this,
+            ignoreSslErrors)) }
     }
 }
\ No newline at end of file