public class SelfSignedSslEngineSource extends Object implements SslEngineSource
SslEngineSource
for testing. The SSLContext
uses
self-signed certificates that are generated lazily if the given key store
file doesn't yet exist.Modifier and Type | Field and Description |
---|---|
private static String |
ALIAS |
private File |
keyStoreFile |
private static org.slf4j.Logger |
LOG |
private static String |
PASSWORD |
private static String |
PROTOCOL |
private boolean |
sendCerts |
private SSLContext |
sslContext |
private boolean |
trustAllServers |
Constructor and Description |
---|
SelfSignedSslEngineSource() |
SelfSignedSslEngineSource(boolean trustAllServers) |
SelfSignedSslEngineSource(boolean trustAllServers,
boolean sendCerts) |
SelfSignedSslEngineSource(String keyStorePath) |
SelfSignedSslEngineSource(String keyStorePath,
boolean trustAllServers,
boolean sendCerts) |
Modifier and Type | Method and Description |
---|---|
SSLContext |
getSslContext() |
private void |
initializeKeyStore() |
private void |
initializeSSLContext() |
private String |
nativeCall(String... commands) |
SSLEngine |
newSslEngine()
Returns an
SSLEngine to use for a server connection from
LittleProxy to the client. |
SSLEngine |
newSslEngine(String peerHost,
int peerPort)
Returns an
SSLEngine to use for a client connection from
LittleProxy to the upstream server. |
private static final org.slf4j.Logger LOG
private static final String ALIAS
private static final String PASSWORD
private static final String PROTOCOL
private final File keyStoreFile
private final boolean trustAllServers
private final boolean sendCerts
private SSLContext sslContext
public SelfSignedSslEngineSource(String keyStorePath, boolean trustAllServers, boolean sendCerts)
public SelfSignedSslEngineSource(String keyStorePath)
public SelfSignedSslEngineSource(boolean trustAllServers)
public SelfSignedSslEngineSource(boolean trustAllServers, boolean sendCerts)
public SelfSignedSslEngineSource()
public SSLEngine newSslEngine()
SslEngineSource
SSLEngine
to use for a server connection from
LittleProxy to the client.newSslEngine
in interface SslEngineSource
public SSLEngine newSslEngine(String peerHost, int peerPort)
SslEngineSource
SSLEngine
to use for a client connection from
LittleProxy to the upstream server. *
Note: Peer information is needed to send the server_name extension in
handshake with Server Name Indication (SNI).newSslEngine
in interface SslEngineSource
peerHost
- to start a client connection to the server.peerPort
- to start a client connection to the server.public SSLContext getSslContext()
private void initializeKeyStore()
private void initializeSSLContext()
Copyright © 2009–2017 LittleShoot. All rights reserved.