Manually verify SSL certificate in WebView

I have an Android WebView that displays some https content. There is a problem with the SSL certificate provided by the server. Although I am waiting for a new certificate that WebView trusts, I am wondering how I can manually verify the SSL certificate.

I have a WebViewClient , where I in onReceivedSslError receives an SslError with the main error code SslError.SSL_UNTRUSTED . On the same error object, I get a certificate, an instance of SslCertificate .

Do I have any way to do any manual checks against this certificate object to make sure it is trustworthy?

I am not interested in accepting all certificates, although this is a temporary thing.

+5
source share

Source: https://habr.com/ru/post/1205605/


All Articles