Class HostnameUnverifiedException

All Implemented Interfaces:
Serializable

public class HostnameUnverifiedException extends WebSocketException
The certificate of the peer does not match the expected hostname.

WebSocketException.getError() of this class returns HOSTNAME_UNVERIFIED.

See Verify that certificate is valid for server hostname (#107).

Since:
2.1
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • mSSLSocket

      private final SSLSocket mSSLSocket
    • mHostname

      private final String mHostname
  • Constructor Details

    • HostnameUnverifiedException

      public HostnameUnverifiedException(SSLSocket socket, 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 Details

    • stringifyPrincipal

      private static String stringifyPrincipal(SSLSocket socket)
    • getSSLSocket

      public SSLSocket getSSLSocket()
      Get the SSL socket against which the hostname verification failed.
      Returns:
      The SSL socket.
    • getHostname

      public String getHostname()
      Get the expected hostname.
      Returns:
      The expected hostname.