Package org.littleshoot.proxy.extras
Class SelfSignedSslEngineSource
java.lang.Object
org.littleshoot.proxy.extras.SelfSignedSslEngineSource
- All Implemented Interfaces:
SslEngineSource
Basic
SslEngineSource for testing. The SSLContext uses
self-signed certificates that are generated lazily if the given key store
file doesn't yet exist.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final Stringprivate static final org.slf4j.Loggerprivate final Stringprivate static final Stringprivate final booleanprivate SSLContextprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionSelfSignedSslEngineSource(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) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidinitializeKeyStore(File keyStoreLocalFile) private voidprivate KeyStoreprivate voidloadKeyStore(KeyStore keyStore, URL url) private StringnativeCall(String... commands) Returns anSSLEngineto use for a server connection from LittleProxy to the client.newSslEngine(String peerHost, int peerPort) Returns anSSLEngineto use for a client connection from LittleProxy to the upstream server.
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
PROTOCOL
- See Also:
-
alias
-
password
-
keyStoreFile
-
trustAllServers
private final boolean trustAllServers -
sendCerts
private final boolean sendCerts -
sslContext
-
-
Constructor Details
-
SelfSignedSslEngineSource
-
SelfSignedSslEngineSource
-
SelfSignedSslEngineSource
-
SelfSignedSslEngineSource
public SelfSignedSslEngineSource(boolean trustAllServers) -
SelfSignedSslEngineSource
public SelfSignedSslEngineSource(boolean trustAllServers, boolean sendCerts) -
SelfSignedSslEngineSource
public SelfSignedSslEngineSource()
-
-
Method Details
-
newSslEngine
Description copied from interface:SslEngineSourceReturns anSSLEngineto use for a server connection from LittleProxy to the client.- Specified by:
newSslEnginein interfaceSslEngineSource
-
newSslEngine
Description copied from interface:SslEngineSourceReturns anSSLEngineto 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).- Specified by:
newSslEnginein interfaceSslEngineSource- Parameters:
peerHost- to start a client connection to the server.peerPort- to start a client connection to the server.
-
getSslContext
-
initializeKeyStore
-
initializeSSLContext
private void initializeSSLContext() -
loadKeyStore
- Throws:
IOExceptionGeneralSecurityException
-
loadKeyStore
- Throws:
IOExceptionGeneralSecurityException
-
nativeCall
-