Package org.microproxy
Enum Class ProxyFailure.TlsFailed.Reason
- All Implemented Interfaces:
Serializable,Comparable<ProxyFailure.TlsFailed.Reason>,Constable
- Enclosing class:
ProxyFailure.TlsFailed
Why a TLS handshake failed, read from the exception's cause chain: the certificate checks
first, then an alert from the peer, a timeout, or anything else.
code() is the
snake_case name the access log's %UPSTREAM_TRANSPORT_FAILURE_REASON% starts with.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe peer ended the handshake with an alert (ProxyFailure.TlsFailed.alert()names it).The certificate (or one in its chain) has expired.The certificate (or one in its chain) is not valid yet.The certificate was revoked: a CRL or an OCSP response said so.The chain does not lead to a trusted anchor, or failed another validation check.The certificate is trusted, but not valid for the host name it was checked against.Anything else: no common protocol version or cipher suite, the connection closed, ...Revocation checking was required, but no CRL or OCSP response could tell.The handshake did not finish within the handshake timeout. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe description of the alert the peer ended a handshake with, as the JDK reports it:"Received fatal alert: unrecognized_name", or"Received handshake warning: ..."for a warning it does not accept during a handshake.code()Returns the reason's name in lower case:certificate_revoked, ....Classifies a failed handshake by its exception's cause chain.Returns the enum constant of this class with the specified name.static ProxyFailure.TlsFailed.Reason[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CERTIFICATE_EXPIRED
The certificate (or one in its chain) has expired. -
CERTIFICATE_NOT_YET_VALID
The certificate (or one in its chain) is not valid yet. -
CERTIFICATE_REVOKED
The certificate was revoked: a CRL or an OCSP response said so. -
REVOCATION_STATUS_UNKNOWN
Revocation checking was required, but no CRL or OCSP response could tell. -
CERTIFICATE_UNTRUSTED
The chain does not lead to a trusted anchor, or failed another validation check. -
HOSTNAME_MISMATCH
The certificate is trusted, but not valid for the host name it was checked against. -
ALERT_RECEIVED
The peer ended the handshake with an alert (ProxyFailure.TlsFailed.alert()names it). -
TIMEOUT
The handshake did not finish within the handshake timeout. -
OTHER
Anything else: no common protocol version or cipher suite, the connection closed, ...
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
code
Returns the reason's name in lower case:certificate_revoked, ....- Returns:
- the reason's name in lower case:
certificate_revoked, ...
-
of
Classifies a failed handshake by its exception's cause chain. ACertPathValidatorExceptionwith aCertPathValidatorException.BasicReason, aCertificateExpiredException,CertificateNotYetValidExceptionorCertificateRevokedExceptionanywhere in it says what was wrong with the certificate (the innermost specific one wins); any other certificate path failure means it is not trusted; a host name check that failed says so in its message (the JDK's"No subject alternative ... matching ..."); and the JDK reports an alert from the peer as"Received fatal alert: <description>".- Parameters:
failure- the handshake's exception, or null- Returns:
- the reason,
OTHERwhen none is recognized
-
alertOf
The description of the alert the peer ended a handshake with, as the JDK reports it:"Received fatal alert: unrecognized_name", or"Received handshake warning: ..."for a warning it does not accept during a handshake.- Parameters:
failure- the handshake's exception, or null- Returns:
- the alert's description, such as
"unrecognized_name", or null
-