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 String |
alias |
private String |
keyStoreFile |
private static org.slf4j.Logger |
LOG |
private 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) |
SelfSignedSslEngineSource(String keyStorePath,
boolean trustAllServers,
boolean sendCerts,
String alias,
String password) |
| Modifier and Type | Method and Description |
|---|---|
SSLContext |
getSslContext() |
private void |
initializeKeyStore(String filename) |
private void |
initializeSSLContext() |
private KeyStore |
loadKeyStore() |
private void |
loadKeyStore(KeyStore keyStore,
URL url) |
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 PROTOCOL
private final String alias
private final String password
private final String keyStoreFile
private final boolean trustAllServers
private final boolean sendCerts
private SSLContext sslContext
public SelfSignedSslEngineSource(String keyStorePath, boolean trustAllServers, boolean sendCerts, String alias, String password)
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()
SslEngineSourceSSLEngine to use for a server connection from
LittleProxy to the client.newSslEngine in interface SslEngineSourcepublic SSLEngine newSslEngine(String peerHost, int peerPort)
SslEngineSourceSSLEngine 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 SslEngineSourcepeerHost - to start a client connection to the server.peerPort - to start a client connection to the server.public SSLContext getSslContext()
private void initializeKeyStore(String filename)
private void initializeSSLContext()
private KeyStore loadKeyStore() throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionprivate void loadKeyStore(KeyStore keyStore, URL url) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionCopyright © 2009–2021. All rights reserved.