Package one.nio.net

Class NativeSslContext

    • 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
    • Constructor Detail

      • NativeSslContext

        NativeSslContext()
                  throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
    • Method Detail

      • 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:
        setDebug in class SslContext
      • setProtocols

        public void setProtocols​(java.lang.String protocols)
        Specified by:
        setProtocols in class SslContext
      • setKernelTlsEnabled

        public void setKernelTlsEnabled​(boolean kernelTlsEnabled)
                                 throws javax.net.ssl.SSLException
        Specified by:
        setKernelTlsEnabled in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setAntiReplayEnabled

        public void setAntiReplayEnabled​(boolean antiReplayEnabled)
                                  throws javax.net.ssl.SSLException
        Specified by:
        setAntiReplayEnabled in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setSessionCache

        public void setSessionCache​(java.lang.String mode,
                                    int size)
                             throws javax.net.ssl.SSLException
        Specified by:
        setSessionCache in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setRdrand

        public void setRdrand​(boolean rdrand)
                       throws javax.net.ssl.SSLException
        Specified by:
        setRdrand in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setCiphers

        public void setCiphers​(java.lang.String ciphers)
                        throws javax.net.ssl.SSLException
        Specified by:
        setCiphers in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setCurve

        public void setCurve​(java.lang.String curve)
                      throws javax.net.ssl.SSLException
        Sets the curve used for ECDH temporary keys used during key exchange. Use openssl ecparam -list_curves to get list of supported curves.
        Specified by:
        setCurve in class SslContext
        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:
        setCertificate in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setPrivateKey

        public void setPrivateKey​(java.lang.String privateKeyFile)
                           throws javax.net.ssl.SSLException
        Specified by:
        setPrivateKey in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setPassphrase

        public void setPassphrase​(byte[] passphrase)
                           throws javax.net.ssl.SSLException
        Specified by:
        setPassphrase in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setCA

        public void setCA​(java.lang.String caFile)
                   throws javax.net.ssl.SSLException
        Specified by:
        setCA in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setVerify

        public void setVerify​(int verifyMode)
                       throws javax.net.ssl.SSLException
        Specified by:
        setVerify in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setTicketKeys

        public void setTicketKeys​(byte[] keys)
                           throws javax.net.ssl.SSLException
        Specified by:
        setTicketKeys in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setTimeout

        public void setTimeout​(long timeout)
                        throws javax.net.ssl.SSLException
        Specified by:
        setTimeout in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setSessionId

        public void setSessionId​(byte[] sessionId)
                          throws javax.net.ssl.SSLException
        Specified by:
        setSessionId in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setOCSP

        public void setOCSP​(byte[] response)
                     throws javax.net.ssl.SSLException
        Specified by:
        setOCSP in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setMaxEarlyData

        public void setMaxEarlyData​(int size)
                             throws javax.net.ssl.SSLException
        Specified by:
        setMaxEarlyData in class SslContext
        Throws:
        javax.net.ssl.SSLException
      • setApplicationProtocols

        public void setApplicationProtocols​(java.lang.String[] protocols)
                                     throws javax.net.ssl.SSLException
        Specified by:
        setApplicationProtocols in class SslContext
        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:
        setSNI in class SslContext
        Throws:
        java.io.IOException
      • setCompressionAlgorithms

        public void setCompressionAlgorithms​(java.lang.String[] compressionAlgorithms)
                                      throws javax.net.ssl.SSLException
        Specified by:
        setCompressionAlgorithms in class SslContext
        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:
        setKeylog in class SslContext
      • 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)