Package org.microproxy
Enum Class MitmServerHandshake
- All Implemented Interfaces:
Serializable,Comparable<MitmServerHandshake>,Constable
When the proxy runs its TLS handshake with the server for a
CONNECT it intercepts:
after answering the CONNECT and reading the client's ClientHello, or before answering.
A field of a ProtocolPolicy (ProtocolPolicy.mitmServerHandshake()), which a
request's filters can override (HttpFilters.proxyToServerMitmHandshake()). Either way,
a handshake that fails is one more failed attempt at its route: the next chained proxy (or the
direct fallback) the ChainedProxyManager offered is tried, after the RetryBackoff wait, as when the connection itself fails.
Proxy authentication happens on the CONNECT in both: the choice is about what the
server's handshake can use and what the client sees when it fails.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTheCONNECTis answered once the proxy is connected to the server (or through a chained proxy's tunnel), and the server's handshake waits for the client's ClientHello, so that it can mirror it: the protocols the client offers by ALPN, and the server name it sends when theCONNECTnamed an IP address.The proxy connects and runs the server's handshake before it answers theCONNECT, as LittleProxy does: itsProxyToServerConnection.initializeConnectionFlowruns the server'sEncryptChannelstep beforeRespondCONNECTSuccessful, so that itsMitmManager.clientSslEngineFor(HttpRequest, SSLSession)has the server's session to make the client's certificate from. -
Method Summary
Modifier and TypeMethodDescriptionstatic MitmServerHandshakeThe value a configuration names:deferredoreager(any case).static MitmServerHandshakeReturns the enum constant of this class with the specified name.static MitmServerHandshake[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFERRED
TheCONNECTis answered once the proxy is connected to the server (or through a chained proxy's tunnel), and the server's handshake waits for the client's ClientHello, so that it can mirror it: the protocols the client offers by ALPN, and the server name it sends when theCONNECTnamed an IP address. That ClientHello also decides whether the session is intercepted at all (host rules,MitmManager.shouldIntercept(org.microproxy.ClientHello, org.microproxy.FlowContext),HttpFilters.proxyToServerAllowMitm(ClientHello)), before any handshake with the server. When every route's handshake fails, the client's handshake still completes, with the proxy's certificate, and its first request in the session is answered502for the TLS failure (ProxyFailure.TlsFailed); a client whose handshake cannot complete is disconnected. The default. -
EAGER
The proxy connects and runs the server's handshake before it answers theCONNECT, as LittleProxy does: itsProxyToServerConnection.initializeConnectionFlowruns the server'sEncryptChannelstep beforeRespondCONNECTSuccessful, so that itsMitmManager.clientSslEngineFor(HttpRequest, SSLSession)has the server's session to make the client's certificate from. The handshake sends theCONNECT's host (or the request'sTlsServerIdentity) as SNI and offers the protocols the proxy would offer on its own (h2andhttp/1.1with HTTP/2 to servers on), since the client's ClientHello has not come yet: neither can be mirrored (a client that then offers only HTTP/1.1 has its requests sent on a second connection that offers what it offered, when the server chose HTTP/2 on the first). A server that speaks no TLS and never answers the proxy's ClientHello holds theCONNECTuntil the TLS handshake timeout. When every route's handshake fails, theCONNECTitself is answered502(ProxyFailure.TlsFailed), and no tunnel opens. A session that the client's ClientHello then decides not to intercept (host rules, the MITM manager, a filter) is tunnelled over a new connection, the one made for the handshake being 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
-
parse
The value a configuration names:deferredoreager(any case).- Parameters:
value- the configuration value- Returns:
- the value it names
- Throws:
IllegalArgumentException- for any other value
-