Package com.yahoo.jrt
Class MaybeTlsCryptoEngine
- java.lang.Object
-
- com.yahoo.jrt.MaybeTlsCryptoEngine
-
- All Implemented Interfaces:
CryptoEngine
,java.lang.AutoCloseable
public class MaybeTlsCryptoEngine extends java.lang.Object implements CryptoEngine
A crypto engine that supports both tls encrypted connections and unencrypted connections. The use of tls for incoming connections is auto-detected using clever heuristics. The use of tls for outgoing connections is controlled by the useTlsWhenClient flag given to the constructor.
-
-
Constructor Summary
Constructors Constructor Description MaybeTlsCryptoEngine(TlsCryptoEngine tlsEngine, boolean useTlsWhenClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
CryptoSocket
createClientCryptoSocket(java.nio.channels.SocketChannel channel, Spec spec)
CryptoSocket
createServerCryptoSocket(java.nio.channels.SocketChannel channel)
java.lang.String
toString()
-
-
-
Constructor Detail
-
MaybeTlsCryptoEngine
public MaybeTlsCryptoEngine(TlsCryptoEngine tlsEngine, boolean useTlsWhenClient)
-
-
Method Detail
-
createClientCryptoSocket
public CryptoSocket createClientCryptoSocket(java.nio.channels.SocketChannel channel, Spec spec)
- Specified by:
createClientCryptoSocket
in interfaceCryptoEngine
-
createServerCryptoSocket
public CryptoSocket createServerCryptoSocket(java.nio.channels.SocketChannel channel)
- Specified by:
createServerCryptoSocket
in interfaceCryptoEngine
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceCryptoEngine
-
-