Skip to content

Commit

Permalink
Using simplified way of removeKeys method
Browse files Browse the repository at this point in the history
Isntead of having to find the hostname and port from an URL (which might be more tricky than expected), we now can simply pass down the URL and `AdvancedX509KeyManager` will take care of finding the port from the URL.

Signed-off-by: Elv1zz <[email protected]>
  • Loading branch information
Elv1zz committed Feb 9, 2023
1 parent c785913 commit 04d7d9e
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import com.owncloud.android.lib.common.network.NetworkUtils
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog
import java.io.ByteArrayInputStream
import java.net.MalformedURLException
import java.security.cert.CertificateException
import java.security.cert.CertificateFactory
import java.security.cert.X509Certificate
Expand Down Expand Up @@ -112,7 +111,7 @@ open class NextcloudWebViewClient(val supportFragmentManager: FragmentManager) :
// chosen client certificate alias does not seem to work -> discard it
val failingUrl = request?.url ?: return
val context = view?.context ?: return
AdvancedX509KeyManager(context).removeKeys(failingUrl.host, failingUrl.port)
AdvancedX509KeyManager(context).removeKeys(failingUrl)
}
}
}

0 comments on commit 04d7d9e

Please sign in to comment.