Interface MitmManager

  • All Known Implementing Classes:
    SelfSignedMitmManager

    public interface MitmManager
    MITMManagers encapsulate the logic required for letting LittleProxy act as a man in the middle for HTTPS requests.
    • Method Detail

      • serverSslEngine

        SSLEngine serverSslEngine​(String peerHost,
                                  int peerPort)
        Creates an SSLEngine for 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.
        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

        SSLEngine serverSslEngine()
        Creates an SSLEngine for encrypting the server connection.
        Returns:
        an SSLEngine used to connect to an upstream server
      • clientSslEngineFor

        SSLEngine clientSslEngineFor​(HttpRequest httpRequest,
                                     SSLSession serverSslSession)

        Creates an SSLEngine for 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.

        Parameters:
        httpRequest - the HTTP CONNECT request that is being man-in-the-middled
        serverSslSession - the SSLSession that's been established with the server
        Returns:
        the SSLEngine used to connect to the client