Package org.omegazero.net.socket
Interface TLSConnection
- All Superinterfaces:
AutoCloseable
,Closeable
,SocketConnection
- All Known Implementing Classes:
NioTLSConnection
Represents a
SocketConnection
encrypted using Transport Layer Security (TLS).- Since:
- 2.1.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns the application layer protocol name negotiated using a mechanism such as Application-Layer Protocol Negotiation (ALPN).Returns the name of the TLS cipher suite used for this connection.Returns the name of the protocol used for this connection.boolean
Returnstrue
if the socket is connected and the TLS handshake has completed.boolean
Returnstrue
if the underlying socket is connected.Methods inherited from interface org.omegazero.net.socket.SocketConnection
close, connect, destroy, flush, getApparentRemoteAddress, getLastIOTime, getLocalAddress, getRemoteAddress, hasConnected, hasDisconnected, isWritable, off, on, on, on, once, read, setApparentRemoteAddress, setOnClose, setOnConnect, setOnData, setOnError, setOnTimeout, setOnWritable, setReadBlock, write, write, write, writeQueue, writeQueue
-
Method Details
-
isConnected
boolean isConnected()Returnstrue
if the socket is connected and the TLS handshake has completed.- Specified by:
isConnected
in interfaceSocketConnection
- Returns:
true
if this socket is connected and the TLS handshake has completed- See Also:
-
isSocketConnected
boolean isSocketConnected()Returnstrue
if the underlying socket is connected.- Returns:
true
if this socket is connected- See Also:
-
getProtocol
String getProtocol()Returns the name of the protocol used for this connection.- Returns:
- The protocol name
-
getCipher
String getCipher()Returns the name of the TLS cipher suite used for this connection.- Returns:
- The TLS cipher name
-
getApplicationProtocol
String getApplicationProtocol()Returns the application layer protocol name negotiated using a mechanism such as Application-Layer Protocol Negotiation (ALPN). If no such negotiation occurred or is not supported by the protocol or implementation,null
is returned.- Returns:
- The application layer protocol name, or
null
if no negotiation occurred
-