Package org.littleshoot.proxy.extras
Class SelfSignedMitmManager
- java.lang.Object
-
- org.littleshoot.proxy.extras.SelfSignedMitmManager
-
- All Implemented Interfaces:
MitmManager
public class SelfSignedMitmManager extends Object implements MitmManager
MitmManagerthat uses self-signed certs for everything.
-
-
Field Summary
Fields Modifier and Type Field Description private SelfSignedSslEngineSourceselfSignedSslEngineSource
-
Constructor Summary
Constructors Constructor Description SelfSignedMitmManager()SelfSignedMitmManager(SelfSignedSslEngineSource selfSignedSslEngineSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SSLEngineclientSslEngineFor(HttpRequest httpRequest, SSLSession serverSslSession)Creates anSSLEnginefor encrypting the client connection based on the given serverSslSession.SSLEngineserverSslEngine()Creates anSSLEnginefor encrypting the server connection.SSLEngineserverSslEngine(String peerHost, int peerPort)Creates anSSLEnginefor encrypting the server connection.
-
-
-
Field Detail
-
selfSignedSslEngineSource
private final SelfSignedSslEngineSource selfSignedSslEngineSource
-
-
Constructor Detail
-
SelfSignedMitmManager
public SelfSignedMitmManager()
-
SelfSignedMitmManager
public SelfSignedMitmManager(SelfSignedSslEngineSource selfSignedSslEngineSource)
-
-
Method Detail
-
serverSslEngine
public SSLEngine serverSslEngine(String peerHost, int peerPort)
Description copied from interface:MitmManagerCreates anSSLEnginefor encrypting the server connection. The SSLEngine created by this method may use the given peer information to send SNI information when connecting to the upstream host.- Specified by:
serverSslEnginein interfaceMitmManager- Parameters:
peerHost- to start a client connection to the server.peerPort- to start a client connection to the server.- Returns:
- an SSLEngine used to connect to an upstream server
-
serverSslEngine
public SSLEngine serverSslEngine()
Description copied from interface:MitmManagerCreates anSSLEnginefor encrypting the server connection.- Specified by:
serverSslEnginein interfaceMitmManager- Returns:
- an SSLEngine used to connect to an upstream server
-
clientSslEngineFor
public SSLEngine clientSslEngineFor(HttpRequest httpRequest, SSLSession serverSslSession)
Description copied from interface:MitmManagerCreates an
SSLEnginefor encrypting the client connection based on the given serverSslSession.The serverSslSession is provided in case this method needs to inspect the server's certificates or something else about the encryption on the way to the server.
This is the place where one would implement impersonation of the server by issuing replacement certificates signed by the proxy's own certificate.
- Specified by:
clientSslEngineForin interfaceMitmManager- Parameters:
httpRequest- the HTTP CONNECT request that is being man-in-the-middledserverSslSession- theSSLSessionthat's been established with the server- Returns:
- the SSLEngine used to connect to the client
-
-