Package com.esri.arcgisruntime.io
Class MismatchedHostnameException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- javax.net.ssl.SSLException
-
- com.esri.arcgisruntime.io.MismatchedHostnameException
-
- All Implemented Interfaces:
java.io.Serializable
public final class MismatchedHostnameException extends javax.net.ssl.SSLException
Represents an exception caused by an SSL certificate whose hostname does not match the common name or any of the subject alternative domain names specified in the certificate. This usually is indicative of a man in the middle attack, but in the cases of self signed certificate, may just be the result of incorrect setup. In the latter case, the user will be allowed to trust it anyway. If, however, there is a mismatched hostname in an SSL certificate issued by a valid CA, then it is almost certainly a man in the middle attack, and it will be forced to fail for security reasons.- Since:
- 100.0.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MismatchedHostnameException(java.lang.String message, java.lang.Throwable cause, java.security.cert.X509Certificate cert, java.lang.String hostname, boolean isSelfSigned)
Creates a MismatchedHostnameException with the specified values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.cert.X509Certificate
getCertificate()
Gets the certificate that was presented but did not match the hostname.java.lang.String
getHostname()
Gets the hostname of the service that presented the certificate.boolean
isSelfSigned()
Checks if the certificate that was presented is self signed.
-
-
-
Constructor Detail
-
MismatchedHostnameException
public MismatchedHostnameException(java.lang.String message, java.lang.Throwable cause, java.security.cert.X509Certificate cert, java.lang.String hostname, boolean isSelfSigned)
Creates a MismatchedHostnameException with the specified values. Specifically, the certificate, hostname, and self signed values are necessary for determining if and how an authentication challenge should be issued.- Parameters:
message
- the message of the exceptioncause
- the original cause of the exceptioncert
- the certificate that was presented but did not match the hostnamehostname
- the hostname of the serviceisSelfSigned
- true if the certificate is self signed (the only allowable situation to be handled. Non self signed certificates with mismatched hostname will NOT go through the AuthenticationChallengeHandler).- Since:
- 100.0.0
-
-
Method Detail
-
getCertificate
public java.security.cert.X509Certificate getCertificate()
Gets the certificate that was presented but did not match the hostname.- Returns:
- the certificate that was presented
- Since:
- 100.0.0
-
getHostname
public java.lang.String getHostname()
Gets the hostname of the service that presented the certificate.- Returns:
- the hostname of the service
- Since:
- 100.0.0
-
isSelfSigned
public boolean isSelfSigned()
Checks if the certificate that was presented is self signed. If it was, then the user will be allowed to override the trust for it. If it was signed by a valid CA, the user will not be allowed to handle it and it will throw the original exception.- Returns:
- true if the certificate presented was self signed, otherwise false
- Since:
- 100.0.0
-
-