public class

MAMCertTrustWebViewClient

extends WebViewClient
java.lang.Object
   ↳ android.webkit.WebViewClient
     ↳ com.microsoft.intune.mam.client.app.MAMCertTrustWebViewClient

Class Overview

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(WebView, SslErrorHandler, SslError) 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(WebViewClient) to register it with the WebView instance.

Summary

[Expand]
Inherited Constants
From class android.webkit.WebViewClient
Public Constructors
MAMCertTrustWebViewClient()
Public Methods
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.
[Expand]
Inherited Methods
From class android.webkit.WebViewClient
From class java.lang.Object

Public Constructors

public MAMCertTrustWebViewClient ()

Public Methods

public 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.