Class MAMCertTrustWebViewClient

  • All Implemented Interfaces:

    
    public class MAMCertTrustWebViewClient
    extends WebViewClient
                        

    MAMCertTrustWebViewClient is a custom implementation of the class android.webkit.WebViewClient that provides a way to handle the SSL error android.net.http.SslError.SSL_UNTRUSTED in a WebView. The class overrides the method onReceivedSslError and handles the SSL error android.net.http.SslError.SSL_UNTRUSTED only. In handling the error, the class uses trusted root certificates that are configured in Intune and received from the MAM service to check the trustworthiness of the host from the target URL that generated the error in WebView. If the custom behavior does not handle the SSL error, the default behavior inherited from the superclass will be executed. When using this class, you should create an instance of it and then call setWebViewClient to register it with the WebView instance.

    • Constructor Detail

      • MAMCertTrustWebViewClient

        MAMCertTrustWebViewClient()
    • Method Detail

      • onReceivedSslError

         void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error)

        Handles the SSL error android.net.http.SslError.SSL_UNTRUSTED by extracting the host, the error certificate, and the authentication type needed to be used by MAM's custom TrustManager instances that have been configured with trusted root certificates received from the MAM service. The method calls android.webkit.SslErrorHandler.proceed only when MAM's TrustManager instances have determined the trustworthiness of the host. When the host trust check fails, the method defers to the default behavior inherited from the superclass.

        Parameters:
        view - The WebView instance that is raising the SSL error.
        handler - An SslErrorHandler that will proceed when the host passes MAM's TrustManager instances host checks.
        error - The SSL error object generated in the WebView instance.