Package one.nio.net
Class NativeSslSocket
- java.lang.Object
-
- one.nio.net.Socket
-
- one.nio.net.NativeSocket
-
- one.nio.net.NativeSslSocket
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.ByteChannel,java.nio.channels.Channel,java.nio.channels.ReadableByteChannel,java.nio.channels.WritableByteChannel
class NativeSslSocket extends NativeSocket
-
-
Field Summary
Fields Modifier and Type Field Description (package private) NativeSslContextcontextprivate booleanisEarlyDataAcceptedprivate booleanisHandshakeDone(package private) longssl-
Fields inherited from class one.nio.net.NativeSocket
fd
-
Fields inherited from class one.nio.net.Socket
AF_INET, AF_INET6, AF_UNIX, IPTOS_LOWDELAY, IPTOS_MINCOST, IPTOS_RELIABILITY, IPTOS_THROUGHPUT, MSG_DONTROUTE, MSG_DONTWAIT, MSG_MORE, MSG_OOB, MSG_PEEK, MSG_TRUNC, MSG_WAITALL, NO_PORT, SO_BROADCAST, SO_BSDCOMPAT, SO_DEBUG, SO_DONTROUTE, SO_ERROR, SO_KEEPALIVE, SO_LINGER, SO_NO_CHECK, SO_OOBINLINE, SO_PASSCRED, SO_PEERCRED, SO_PRIORITY, SO_RCVBUF, SO_RCVLOWAT, SO_RCVTIMEO, SO_REUSEADDR, SO_REUSEPORT, SO_SNDBUF, SO_SNDLOWAT, SO_SNDTIMEO, SO_TYPE, SOCK_DGRAM, SOCK_RAW, SOCK_RDM, SOCK_SEQPACKET, SOCK_STREAM, SOL_IP, SOL_IPV6, SOL_SOCKET, SOL_TCP, SOL_UDP, TCP_CONGESTION, TCP_CORK, TCP_DEFER_ACCEPT, TCP_INFO, TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_LINGER2, TCP_MAXSEG, TCP_NODELAY, TCP_QUICKACK, TCP_SYNCNT, TCP_USER_TIMEOUT, TCP_WINDOW_CLAMP
-
-
Constructor Summary
Constructors Constructor Description NativeSslSocket(int fd, NativeSslContext context, boolean serverMode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NativeSocketaccept()NativeSocketacceptNonBlocking()voidclose()SslContextgetSslContext()java.lang.ObjectgetSslOption(SslOption option)voidhandshake()intread(byte[] data, int offset, int count, int flags)voidreadFully(byte[] data, int offset, int count)intreadRaw(long buf, int count, int flags)(package private) longsendFile0(int sourceFD, long offset, long count)private java.lang.StringsslCertName(int which)private java.lang.StringsslCurrentCipher()(package private) static voidsslFree(long ssl)private booleansslHandshakeDone()(package private) static longsslNew(int fd, long ctx, boolean serverMode)private byte[]sslPeerCertificate()private java.lang.Object[]sslPeerCertificateChain()private booleansslSessionEarlyDataAccepted()private booleansslSessionReused()private intsslSessionTicket()SocketsslUnwrap()private java.lang.StringsslVerifyResult()intwrite(byte[] data, int offset, int count, int flags)voidwriteFully(byte[] data, int offset, int count)intwriteRaw(long buf, int count, int flags)-
Methods inherited from class one.nio.net.NativeSocket
accept0, bind, bind, bind0, connect, connect, connect0, getDeferAccept, getKeepAlive, getLocalAddress, getNoDelay, getNotsentLowat, getOption, getRecvBuffer, getRemoteAddress, getReuseAddr, getReusePort, getSendBuffer, getTcpFastOpen, getThinLinearTimeouts, getTimeout, getTos, isBlocking, isOpen, listen, read, recv, recvFrom0, recvFrom1, recvMsg, recvMsg0, send, send, sendFile, sendMsg, sendMsg0, sendTo0, sendTo1, setBlocking, setDeferAccept, setKeepAlive, setNoDelay, setNotsentLowat, setOption, setRecvBuffer, setReuseAddr, setSendBuffer, setTcpFastOpen, setThinLinearTimeouts, setTimeout, setTos, sslWrap, toNativeAddr, write
-
Methods inherited from class one.nio.net.Socket
bindInet, bindUnix, connectInet, connectUnix, create, createClientSocket, createClientSocket, createDatagramSocket, createServerSocket, createUnixSocket, fromFD, read, write
-
-
-
-
Field Detail
-
context
NativeSslContext context
-
ssl
long ssl
-
isEarlyDataAccepted
private volatile boolean isEarlyDataAccepted
-
isHandshakeDone
private volatile boolean isHandshakeDone
-
-
Constructor Detail
-
NativeSslSocket
NativeSslSocket(int fd, NativeSslContext context, boolean serverMode) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classNativeSocket
-
accept
public NativeSocket accept() throws java.io.IOException
- Overrides:
acceptin classNativeSocket- Throws:
java.io.IOException
-
acceptNonBlocking
public NativeSocket acceptNonBlocking() throws java.io.IOException
- Overrides:
acceptNonBlockingin classNativeSocket- Throws:
java.io.IOException
-
sslUnwrap
public Socket sslUnwrap()
- Overrides:
sslUnwrapin classNativeSocket
-
getSslContext
public SslContext getSslContext()
- Overrides:
getSslContextin classNativeSocket
-
getSslOption
public java.lang.Object getSslOption(SslOption option)
- Overrides:
getSslOptionin classNativeSocket
-
handshake
public void handshake() throws java.io.IOException
-
writeRaw
public int writeRaw(long buf, int count, int flags) throws java.io.IOException- Overrides:
writeRawin classNativeSocket- Throws:
java.io.IOException
-
write
public int write(byte[] data, int offset, int count, int flags) throws java.io.IOException- Overrides:
writein classNativeSocket- Throws:
java.io.IOException
-
writeFully
public void writeFully(byte[] data, int offset, int count) throws java.io.IOException- Overrides:
writeFullyin classNativeSocket- Throws:
java.io.IOException
-
readRaw
public int readRaw(long buf, int count, int flags) throws java.io.IOException- Overrides:
readRawin classNativeSocket- Throws:
java.io.IOException
-
read
public int read(byte[] data, int offset, int count, int flags) throws java.io.IOException- Overrides:
readin classNativeSocket- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] data, int offset, int count) throws java.io.IOException- Overrides:
readFullyin classNativeSocket- Throws:
java.io.IOException
-
sendFile0
long sendFile0(int sourceFD, long offset, long count) throws java.io.IOException- Overrides:
sendFile0in classNativeSocket- Throws:
java.io.IOException
-
sslSessionEarlyDataAccepted
private boolean sslSessionEarlyDataAccepted()
-
sslHandshakeDone
private boolean sslHandshakeDone()
-
sslPeerCertificate
private byte[] sslPeerCertificate()
-
sslPeerCertificateChain
private java.lang.Object[] sslPeerCertificateChain()
-
sslCertName
private java.lang.String sslCertName(int which)
-
sslVerifyResult
private java.lang.String sslVerifyResult()
-
sslSessionReused
private boolean sslSessionReused()
-
sslSessionTicket
private int sslSessionTicket()
-
sslCurrentCipher
private java.lang.String sslCurrentCipher()
-
sslNew
static long sslNew(int fd, long ctx, boolean serverMode) throws java.io.IOException- Throws:
java.io.IOException
-
sslFree
static void sslFree(long ssl)
-
-