forked from adamfisk/LittleProxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEncryptedTCPChainedProxyTest.java
39 lines (31 loc) · 1.09 KB
/
EncryptedTCPChainedProxyTest.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
package org.littleshoot.proxy;
import static org.littleshoot.proxy.TransportProtocol.*;
import javax.net.ssl.SSLEngine;
import org.littleshoot.proxy.extras.SelfSignedSslEngineSource;
public class EncryptedTCPChainedProxyTest extends BaseChainedProxyTest {
private final SslEngineSource sslEngineSource = new SelfSignedSslEngineSource(
"chain_proxy_keystore_1.jks");
@Override
protected HttpProxyServerBootstrap upstreamProxy() {
return super.upstreamProxy()
.withTransportProtocol(TCP)
.withSslEngineSource(sslEngineSource);
}
@Override
protected ChainedProxy newChainedProxy() {
return new BaseChainedProxy() {
@Override
public TransportProtocol getTransportProtocol() {
return TransportProtocol.TCP;
}
@Override
public boolean requiresEncryption() {
return true;
}
@Override
public SSLEngine newSslEngine() {
return sslEngineSource.newSslEngine();
}
};
}
}