public class SSLException
extends java.io.IOException
Modifier and Type | Field and Description |
---|---|
static int |
ALERT_ACCESS_DENIED
TLS protocol Alert description "ACCESS_DENIED" (49).
|
static int |
ALERT_BAD_CERTIFICATE
SSL/TLS protocol Alert description "BAD_CERTIFICATE" (42).
|
static int |
ALERT_BAD_CERTIFICATE_HASH_VALUE
TLS protocol extensions Alert description "BAD_CERTIFICATE_HASH_VALUE" (114).
|
static int |
ALERT_BAD_CERTIFICATE_STATUS_RESPONSE
TLS protocol extensions Alert description "BAD_CERTIFICATE_STATUS_RESPONSE" (113).
|
static int |
ALERT_BAD_RECORD_MAC
SSL/TLS protocol Alert description "BAD_RECORD_MAC" (20).
|
static int |
ALERT_CERTIFICATE_EXPIRED
SSL/TLS protocol Alert description "CERTIFICATE_EXPIRED" (45).
|
static int |
ALERT_CERTIFICATE_REQUIRED
TLS protocol Alert description "CERTIFICATE_REQUIRED" (116).
|
static int |
ALERT_CERTIFICATE_REVOKED
SSL/TLS protocol Alert description "CERTIFICATE_REVOKED" (44).
|
static int |
ALERT_CERTIFICATE_UNKNOWN
SSL/TLS protocol Alert description "CERTIFICATE_UNKNOWN" (46).
|
static int |
ALERT_CERTIFICATE_UNOBTAINABLE
TLS protocol extensions Alert description "CERTIFICATE_UNOBTAINABLE" (111).
|
static int |
ALERT_CLOSE_NOTIFY
SSL/TLS protocol Alert description "CLOSE_NOTIFY" (0).
|
static int |
ALERT_DECODE_ERROR
TLS protocol Alert description "DECODE_ERROR" (50).
|
static int |
ALERT_DECOMPRESSION_FAILURE
SSL/TLS protocol Alert description "DECOMPRESSION_FAILURE" (30).
|
static int |
ALERT_DECRYPT_ERROR
TLS protocol Alert description "DECRYPT_ERROR" (51).
|
static int |
ALERT_DECRYPTION_FAILED
TLS protocol Alert description "DECRYPTION_FAILED" (21).
|
static int |
ALERT_EXPORT_RESTRICTION
TLS protocol Alert description "EXPORT_RESTRICTION" (60).
|
static int |
ALERT_HANDSHAKE_FAILURE
SSL/TLS protocol Alert description "HANDSHAKE_FAILURE" (40).
|
static int |
ALERT_ILLEGAL_PARAMETER
SSL/TLS protocol Alert description "ILLEGAL_PARAMETER" (47).
|
static int |
ALERT_INSUFFICIENT_SECURITY
TLS protocol Alert description "INSUFFICIENT_SECURITY" (71).
|
static int |
ALERT_INTERNAL_ERROR
TLS protocol Alert description "INTERNAL_ERROR" (80).
|
static int |
ALERT_LEVEL_FATAL
Alert level FATAL (2).
|
static int |
ALERT_LEVEL_WARNING
Alert level WARNING (1).
|
static int |
ALERT_MISSING_EXTENSION
TLS protocol Alert description "MISSING_EXTENSION" (109).
|
static int |
ALERT_NO_CERTIFICATE
SSL protocol Alert description "NO_CERTIFICATE" (41).
|
static int |
ALERT_NO_RENEGOTIATION
TLS protocol Alert description "NO_RENEGOTIATION" (100).
|
static int |
ALERT_PROTOCOL_VERSION
TLS protocol Alert description "PROTOCOL_VERSION" (70).
|
static int |
ALERT_RECORD_OVERFLOW
TLS protocol Alert description "RECORD_OVERFLOW" (22).
|
static int |
ALERT_UNEXPECTED_MESSAGE
SSL/TLS protocol Alert description "UNEXPECTED_MESSAGE" (10).
|
static int |
ALERT_UNKNOWN_CA
TLS protocol Alert description "UNKNOWN_CA" (48).
|
static int |
ALERT_UNKNOWN_PSK_IDENTITY
TLS-PSK (RFC 4279) protocol Alert description
"UNKNOWN_PSK_IDENTITY" (115).
|
static int |
ALERT_UNRECOGNIZED_NAME
TLS protocol extensions Alert description "UNRECOGNIZED_NAME" (112).
|
static int |
ALERT_UNSUPPORTED_CERTIFICATE
SSL/TLS protocol Alert description "UNSUPPORTED_CERTIFICATE" (43).
|
static int |
ALERT_UNSUPPORTED_EXTENSION
TLS protocol extensions Alert description "UNSUPPORTED_EXTENSION" (110).
|
static int |
ALERT_USER_CANCELED
TLS protocol Alert description "USER_CANCELED" (90).
|
static int |
ALERT_V2_BAD_CERTIFICATE
SSLv2 protocol Alert description "BAD_CERTIFICATE" (4).
|
static int |
ALERT_V2_NO_CERTIFICATE
SSLv2 protocol Alert description "NO_CERTIFICATE" (2).
|
static int |
ALERT_V2_NO_CIPHER
SSLv2 protocol Alert description "NO_CIPHER" (1).
|
static int |
ALERT_V2_UNDEFINED_ERROR
SSLv2 protocol Alert description "UNDEFINED_ERROR" (0).
|
static int |
ALERT_V2_UNSUPPORTED_CERTIFICATE_TYPE
SSLv2 protocol Alert description "UNSUPPORTED_CERTIFICATE_TYPE" (6).
|
Constructor and Description |
---|
SSLException(java.lang.Exception wrappedException)
Creates a SSLException with the specified wrapped exception.
|
SSLException(java.lang.String string)
Constructs an SSLException with the given message.
|
SSLException(java.lang.String msg,
java.lang.Exception wrappedException)
Creates a SSLException with the specified message and wrapped exception.
|
Modifier and Type | Method and Description |
---|---|
boolean |
alertFromPeer()
Checks whether this exception has been thrown because
of an alert received from the peer.
|
int |
getAlertDescription()
Returns the alert description, if assigned to this exception.
|
int |
getAlertLevel()
Returns the alert level, if assigned to this exception.
|
java.lang.Exception |
getWrappedException()
Gets the wrapped exception.
|
public static final int ALERT_LEVEL_WARNING
public static final int ALERT_LEVEL_FATAL
public static final int ALERT_CLOSE_NOTIFY
public static final int ALERT_UNEXPECTED_MESSAGE
public static final int ALERT_BAD_RECORD_MAC
public static final int ALERT_DECRYPTION_FAILED
public static final int ALERT_RECORD_OVERFLOW
public static final int ALERT_DECOMPRESSION_FAILURE
public static final int ALERT_HANDSHAKE_FAILURE
public static final int ALERT_NO_CERTIFICATE
public static final int ALERT_BAD_CERTIFICATE
public static final int ALERT_UNSUPPORTED_CERTIFICATE
public static final int ALERT_CERTIFICATE_REVOKED
public static final int ALERT_CERTIFICATE_EXPIRED
public static final int ALERT_CERTIFICATE_UNKNOWN
public static final int ALERT_ILLEGAL_PARAMETER
public static final int ALERT_UNKNOWN_CA
public static final int ALERT_ACCESS_DENIED
public static final int ALERT_DECODE_ERROR
public static final int ALERT_DECRYPT_ERROR
public static final int ALERT_EXPORT_RESTRICTION
public static final int ALERT_PROTOCOL_VERSION
public static final int ALERT_INSUFFICIENT_SECURITY
public static final int ALERT_INTERNAL_ERROR
public static final int ALERT_USER_CANCELED
public static final int ALERT_NO_RENEGOTIATION
public static final int ALERT_UNSUPPORTED_EXTENSION
public static final int ALERT_CERTIFICATE_UNOBTAINABLE
public static final int ALERT_UNRECOGNIZED_NAME
public static final int ALERT_BAD_CERTIFICATE_STATUS_RESPONSE
public static final int ALERT_BAD_CERTIFICATE_HASH_VALUE
public static final int ALERT_UNKNOWN_PSK_IDENTITY
public static final int ALERT_MISSING_EXTENSION
public static final int ALERT_CERTIFICATE_REQUIRED
public static final int ALERT_V2_UNDEFINED_ERROR
public static final int ALERT_V2_NO_CIPHER
public static final int ALERT_V2_NO_CERTIFICATE
public static final int ALERT_V2_BAD_CERTIFICATE
public static final int ALERT_V2_UNSUPPORTED_CERTIFICATE_TYPE
public SSLException(java.lang.String string)
string
- the exception messagepublic SSLException(java.lang.String msg, java.lang.Exception wrappedException)
msg
- the exception messagewrappedException
- the wrapped (original) exceptionpublic SSLException(java.lang.Exception wrappedException)
wrappedException
- the wrapped (original) exceptionpublic int getAlertDescription()
received
from the peer, this
method may be used to query for the SSL/TLS protocol
specific alert description (e.g. ALERT_BAD_CERTIFICATE
, ALERT_HANDSHAKE_FAILURE
of the alert message received
from the peer:
... try { ... } catch (SSLException ex) { if (ex.alertFromPeer()) { int alertDescription = ex.getAlertDescription(); } }If the exception has NOT been caused by an alert received from the peer, the alert description (if set) returned by this method will indicate the description that will be sent within an alert message to the peer.
public int getAlertLevel()
received
from the peer, this
method may be used to query for the SSL/TLS protocol
specific alert level (ALERT_LEVEL_WARNING
or ALERT_LEVEL_FATAL
of the alert message received
from the peer:
... try { ... } catch (SSLException ex) { if (ex.alertFromPeer()) { int alertLevel = ex.getAlertLevel(); } }If the exception has NOT been caused by an alert received from the peer, the alert level (if set) returned by this method will indicate the level that will be sent within an alert message to the peer.
However, although an alert may have WARNING or FATAL level, an SSLException typically may be thrown only if a FATAL alert has been received or has to be sent.
public boolean alertFromPeer()
true
if this exception is caused by
an Alert received from the peer; false
if an Alert is sent to the peer indicating some
problempublic java.lang.Exception getWrappedException()
null
if this Exception is the original exception