Package one.nio.net
Class NativeSslContext
- java.lang.Object
-
- one.nio.net.SslContext
-
- one.nio.net.NativeSslContext
-
class NativeSslContext extends SslContext
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classNativeSslContext.CacheModeprivate static classNativeSslContext.CompressionAlgorithms(package private) static classNativeSslContext.Holderprivate classNativeSslContext.NativeSslContextMXBeanImplprivate static classNativeSslContext.SslOption
-
Field Summary
Fields Modifier and Type Field Description private static longALL_DISABLEDprivate static java.util.concurrent.atomic.AtomicIntegercounter(package private) longctx(package private) intid(package private) NativeSslContext[]subcontexts-
Fields inherited from class one.nio.net.SslContext
currentConfig, VERIFY_NONE, VERIFY_ONCE, VERIFY_PEER, VERIFY_REQUIRE_PEER_CERT
-
-
Constructor Summary
Constructors Constructor Description NativeSslContext()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidclearOptions(long options)voidclose()private NativeSslContext[]createSubcontexts(SslConfig[] sni)private static voidctxFree(long ctx)private static longctxNew()booleangetDebug()private longgetSessionCounter(int key)private long[]getSessionCounters(int keysBitmap)private static voidinit()voidsetAntiReplayEnabled(boolean antiReplayEnabled)voidsetApplicationProtocols(java.lang.String[] protocols)private voidsetApplicationProtocols0(byte[] protocols)voidsetCA(java.lang.String caFile)private voidsetCacheMode(int mode)voidsetCertificate(java.lang.String certFile)voidsetCiphers(java.lang.String ciphers)voidsetCompressionAlgorithms(java.lang.String[] compressionAlgorithms)private voidsetCompressionAlgorithms0(int[] algorithms)voidsetCurve(java.lang.String curve)Sets the curve used for ECDH temporary keys used during key exchange.voidsetDebug(boolean debug)private voidsetInternalCacheSize(int size)voidsetKernelTlsEnabled(boolean kernelTlsEnabled)voidsetKeylog(boolean keylog)voidsetMaxEarlyData(int size)voidsetOCSP(byte[] response)private voidsetOptions(long options)voidsetPassphrase(byte[] passphrase)voidsetPrivateKey(java.lang.String privateKeyFile)voidsetProtocols(java.lang.String protocols)voidsetRdrand(boolean rdrand)voidsetSessionCache(java.lang.String mode, int size)voidsetSessionId(byte[] sessionId)voidsetSNI(SslConfig[] sni)private voidsetSNI0(byte[] names, long[] contexts)private voidsetSubcontexts(NativeSslContext[] newSubcontexts)voidsetTicketKeys(byte[] keys)voidsetTimeout(long timeout)voidsetVerify(int verifyMode)-
Methods inherited from class one.nio.net.SslContext
configure, create, getDefault, refresh, updateCertificates, updateOCSP, updateTicketKeys
-
-
-
-
Field Detail
-
counter
private static final java.util.concurrent.atomic.AtomicInteger counter
-
ALL_DISABLED
private static final long ALL_DISABLED
-
id
final int id
-
ctx
long ctx
-
subcontexts
NativeSslContext[] subcontexts
-
-
Method Detail
-
close
public void close()
- Overrides:
closein classSslContext
-
setSubcontexts
private void setSubcontexts(NativeSslContext[] newSubcontexts)
-
createSubcontexts
private NativeSslContext[] createSubcontexts(SslConfig[] sni) throws java.io.IOException
- Throws:
java.io.IOException
-
setDebug
public void setDebug(boolean debug)
- Specified by:
setDebugin classSslContext
-
getDebug
public boolean getDebug()
- Specified by:
getDebugin classSslContext
-
setProtocols
public void setProtocols(java.lang.String protocols)
- Specified by:
setProtocolsin classSslContext
-
setKernelTlsEnabled
public void setKernelTlsEnabled(boolean kernelTlsEnabled) throws javax.net.ssl.SSLException- Specified by:
setKernelTlsEnabledin classSslContext- Throws:
javax.net.ssl.SSLException
-
setAntiReplayEnabled
public void setAntiReplayEnabled(boolean antiReplayEnabled) throws javax.net.ssl.SSLException- Specified by:
setAntiReplayEnabledin classSslContext- Throws:
javax.net.ssl.SSLException
-
setSessionCache
public void setSessionCache(java.lang.String mode, int size) throws javax.net.ssl.SSLException- Specified by:
setSessionCachein classSslContext- Throws:
javax.net.ssl.SSLException
-
setRdrand
public void setRdrand(boolean rdrand) throws javax.net.ssl.SSLException- Specified by:
setRdrandin classSslContext- Throws:
javax.net.ssl.SSLException
-
setCiphers
public void setCiphers(java.lang.String ciphers) throws javax.net.ssl.SSLException- Specified by:
setCiphersin classSslContext- Throws:
javax.net.ssl.SSLException
-
setCurve
public void setCurve(java.lang.String curve) throws javax.net.ssl.SSLExceptionSets the curve used for ECDH temporary keys used during key exchange. Useopenssl ecparam -list_curvesto get list of supported curves.- Specified by:
setCurvein classSslContext- Parameters:
curve- short name of the curve, if null - all curves built into the OpenSSL library will be allowed- Throws:
javax.net.ssl.SSLException
-
setCertificate
public void setCertificate(java.lang.String certFile) throws javax.net.ssl.SSLException- Specified by:
setCertificatein classSslContext- Throws:
javax.net.ssl.SSLException
-
setPrivateKey
public void setPrivateKey(java.lang.String privateKeyFile) throws javax.net.ssl.SSLException- Specified by:
setPrivateKeyin classSslContext- Throws:
javax.net.ssl.SSLException
-
setPassphrase
public void setPassphrase(byte[] passphrase) throws javax.net.ssl.SSLException- Specified by:
setPassphrasein classSslContext- Throws:
javax.net.ssl.SSLException
-
setCA
public void setCA(java.lang.String caFile) throws javax.net.ssl.SSLException- Specified by:
setCAin classSslContext- Throws:
javax.net.ssl.SSLException
-
setVerify
public void setVerify(int verifyMode) throws javax.net.ssl.SSLException- Specified by:
setVerifyin classSslContext- Throws:
javax.net.ssl.SSLException
-
setTicketKeys
public void setTicketKeys(byte[] keys) throws javax.net.ssl.SSLException- Specified by:
setTicketKeysin classSslContext- Throws:
javax.net.ssl.SSLException
-
setTimeout
public void setTimeout(long timeout) throws javax.net.ssl.SSLException- Specified by:
setTimeoutin classSslContext- Throws:
javax.net.ssl.SSLException
-
setSessionId
public void setSessionId(byte[] sessionId) throws javax.net.ssl.SSLException- Specified by:
setSessionIdin classSslContext- Throws:
javax.net.ssl.SSLException
-
setOCSP
public void setOCSP(byte[] response) throws javax.net.ssl.SSLException- Specified by:
setOCSPin classSslContext- Throws:
javax.net.ssl.SSLException
-
setMaxEarlyData
public void setMaxEarlyData(int size) throws javax.net.ssl.SSLException- Specified by:
setMaxEarlyDatain classSslContext- Throws:
javax.net.ssl.SSLException
-
setApplicationProtocols
public void setApplicationProtocols(java.lang.String[] protocols) throws javax.net.ssl.SSLException- Specified by:
setApplicationProtocolsin classSslContext- Throws:
javax.net.ssl.SSLException
-
setApplicationProtocols0
private void setApplicationProtocols0(byte[] protocols) throws javax.net.ssl.SSLException- Throws:
javax.net.ssl.SSLException
-
setSNI
public void setSNI(SslConfig[] sni) throws java.io.IOException
- Specified by:
setSNIin classSslContext- Throws:
java.io.IOException
-
setCompressionAlgorithms
public void setCompressionAlgorithms(java.lang.String[] compressionAlgorithms) throws javax.net.ssl.SSLException- Specified by:
setCompressionAlgorithmsin classSslContext- Throws:
javax.net.ssl.SSLException
-
setCompressionAlgorithms0
private void setCompressionAlgorithms0(int[] algorithms) throws javax.net.ssl.SSLException- Throws:
javax.net.ssl.SSLException
-
setSNI0
private void setSNI0(byte[] names, long[] contexts) throws javax.net.ssl.SSLException- Throws:
javax.net.ssl.SSLException
-
setKeylog
public void setKeylog(boolean keylog)
- Specified by:
setKeylogin classSslContext
-
setOptions
private void setOptions(long options)
-
clearOptions
private void clearOptions(long options)
-
getSessionCounter
private long getSessionCounter(int key)
-
getSessionCounters
private long[] getSessionCounters(int keysBitmap)
-
setInternalCacheSize
private void setInternalCacheSize(int size) throws javax.net.ssl.SSLException- Throws:
javax.net.ssl.SSLException
-
setCacheMode
private void setCacheMode(int mode) throws javax.net.ssl.SSLException- Throws:
javax.net.ssl.SSLException
-
init
private static void init()
-
ctxNew
private static long ctxNew() throws javax.net.ssl.SSLException- Throws:
javax.net.ssl.SSLException
-
ctxFree
private static void ctxFree(long ctx)
-
-