Package com.neovisionaries.ws.client
Class HostnameUnverifiedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.neovisionaries.ws.client.WebSocketException
-
- com.neovisionaries.ws.client.HostnameUnverifiedException
-
- All Implemented Interfaces:
java.io.Serializable
public class HostnameUnverifiedException extends WebSocketException
The certificate of the peer does not match the expected hostname.WebSocketException.getError()of this class returnsHOSTNAME_UNVERIFIED.See Verify that certificate is valid for server hostname (#107).
- Since:
- 2.1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringmHostnameprivate javax.net.ssl.SSLSocketmSSLSocketprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description HostnameUnverifiedException(javax.net.ssl.SSLSocket socket, java.lang.String hostname)Constructor with the SSL socket and the expected hostname.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHostname()Get the expected hostname.javax.net.ssl.SSLSocketgetSSLSocket()Get the SSL socket against which the hostname verification failed.private static java.lang.StringstringifyPrincipal(javax.net.ssl.SSLSocket socket)-
Methods inherited from class com.neovisionaries.ws.client.WebSocketException
getError
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
mSSLSocket
private final javax.net.ssl.SSLSocket mSSLSocket
-
mHostname
private final java.lang.String mHostname
-
-
Constructor Detail
-
HostnameUnverifiedException
public HostnameUnverifiedException(javax.net.ssl.SSLSocket socket, java.lang.String hostname)Constructor with the SSL socket and the expected hostname.- Parameters:
socket- The SSL socket against which the hostname verification failed.hostname- The expected hostname.
-
-
Method Detail
-
stringifyPrincipal
private static java.lang.String stringifyPrincipal(javax.net.ssl.SSLSocket socket)
-
getSSLSocket
public javax.net.ssl.SSLSocket getSSLSocket()
Get the SSL socket against which the hostname verification failed.- Returns:
- The SSL socket.
-
getHostname
public java.lang.String getHostname()
Get the expected hostname.- Returns:
- The expected hostname.
-
-