Class MAMCertTrustWebViewClient
-
- All Implemented Interfaces:
public class MAMCertTrustWebViewClient extends WebViewClientMAMCertTrustWebViewClient 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.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intERROR_AUTHENTICATIONpublic final static intERROR_BAD_URLpublic final static intERROR_CONNECTpublic final static intERROR_FAILED_SSL_HANDSHAKEpublic final static intERROR_FILEpublic final static intERROR_FILE_NOT_FOUNDpublic final static intERROR_HOST_LOOKUPpublic final static intERROR_IOpublic final static intERROR_PROXY_AUTHENTICATIONpublic final static intERROR_REDIRECT_LOOPpublic final static intERROR_TIMEOUTpublic final static intERROR_TOO_MANY_REQUESTSpublic final static intERROR_UNKNOWNpublic final static intERROR_UNSAFE_RESOURCEpublic final static intERROR_UNSUPPORTED_AUTH_SCHEMEpublic final static intERROR_UNSUPPORTED_SCHEMEpublic final static intSAFE_BROWSING_THREAT_BILLINGpublic final static intSAFE_BROWSING_THREAT_MALWAREpublic final static intSAFE_BROWSING_THREAT_PHISHINGpublic final static intSAFE_BROWSING_THREAT_UNKNOWNpublic final static intSAFE_BROWSING_THREAT_UNWANTED_SOFTWARE
-
Constructor Summary
Constructors Constructor Description MAMCertTrustWebViewClient()
-
Method Summary
Modifier and Type Method Description voidonReceivedSslError(WebView view, SslErrorHandler handler, SslError error)Handles the SSL error android.net.http.SslError. -
Methods inherited from class android.webkit.WebViewClient
doUpdateVisitedHistory, onFormResubmission, onLoadResource, onPageCommitVisible, onPageFinished, onPageStarted, onReceivedClientCertRequest, onReceivedError, onReceivedHttpAuthRequest, onReceivedHttpError, onReceivedLoginRequest, onRenderProcessGone, onSafeBrowsingHit, onScaleChanged, onTooManyRedirects, onUnhandledKeyEvent, shouldInterceptRequest, shouldOverrideKeyEvent, shouldOverrideUrlLoading -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
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.
-
-
-
-