forked from adamfisk/LittleProxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MitmManager.java
41 lines (38 loc) · 1.15 KB
/
MitmManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package org.littleshoot.proxy;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLSession;
/**
* MITMManagers encapsulate the logic required for letting LittleProxy act as a
* man in the middle for HTTPS requests.
*/
public interface MitmManager {
/**
* Creates an {@link SSLEngine} for encrypting the server connection.
*
* @return
*/
SSLEngine serverSslEngine();
/**
* <p>
* Creates an {@link SSLEngine} for encrypting the client connection based
* on the given serverSslSession.
* </p>
*
* <p>
* 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.
* </p>
*
* <p>
* This is the place where one would implement impersonation of the server
* by issuing replacement certificates signed by the proxy's own
* certificate.
* </p>
*
* @param serverSslSession
* the {@link SSLSession} that's been established with the server
* @return
*/
SSLEngine clientSslEngineFor(SSLSession serverSslSession);
}