Class ReferenceCountedOpenSslEngine

    • Method Detail

      • setOcspResponse

        @UnstableApi
        public void setOcspResponse​(byte[] response)
        Sets the OCSP response.
      • getOcspResponse

        @UnstableApi
        public byte[] getOcspResponse()
        Returns the OCSP response or null if the server didn't provide a stapled OCSP response.
      • refCnt

        public final int refCnt()
        Description copied from interface: ReferenceCounted
        Returns the reference count of this object. If 0, it means this object has been deallocated.
        Specified by:
        refCnt in interface ReferenceCounted
      • touch

        public final ReferenceCounted touch​(java.lang.Object hint)
        Description copied from interface: ReferenceCounted
        Records the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you via ResourceLeakDetector.
        Specified by:
        touch in interface ReferenceCounted
      • release

        public final boolean release()
        Description copied from interface: ReferenceCounted
        Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
        Specified by:
        release in interface ReferenceCounted
        Returns:
        true if and only if the reference count became 0 and this object has been deallocated
      • release

        public final boolean release​(int decrement)
        Description copied from interface: ReferenceCounted
        Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
        Specified by:
        release in interface ReferenceCounted
        Returns:
        true if and only if the reference count became 0 and this object has been deallocated
      • getApplicationProtocol

        public java.lang.String getApplicationProtocol()
        Overrides:
        getApplicationProtocol in class javax.net.ssl.SSLEngine
      • getHandshakeApplicationProtocol

        public java.lang.String getHandshakeApplicationProtocol()
        Overrides:
        getHandshakeApplicationProtocol in class javax.net.ssl.SSLEngine
      • getHandshakeSession

        public final javax.net.ssl.SSLSession getHandshakeSession()
        Overrides:
        getHandshakeSession in class javax.net.ssl.SSLEngine
      • sslPointer

        public final long sslPointer()
        Returns the pointer to the SSL object for this ReferenceCountedOpenSslEngine. Be aware that it is freed as soon as the release() or shutdown() methods are called. At this point 0 will be returned.
      • shutdown

        public final void shutdown()
        Destroys this engine.
      • wrap

        public final javax.net.ssl.SSLEngineResult wrap​(java.nio.ByteBuffer[] srcs,
                                                        int offset,
                                                        int length,
                                                        java.nio.ByteBuffer dst)
                                                 throws javax.net.ssl.SSLException
        Specified by:
        wrap in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • unwrap

        public final javax.net.ssl.SSLEngineResult unwrap​(java.nio.ByteBuffer[] srcs,
                                                          int srcsOffset,
                                                          int srcsLength,
                                                          java.nio.ByteBuffer[] dsts,
                                                          int dstsOffset,
                                                          int dstsLength)
                                                   throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
      • unwrap

        public final javax.net.ssl.SSLEngineResult unwrap​(java.nio.ByteBuffer[] srcs,
                                                          java.nio.ByteBuffer[] dsts)
                                                   throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
      • unwrap

        public final javax.net.ssl.SSLEngineResult unwrap​(java.nio.ByteBuffer src,
                                                          java.nio.ByteBuffer[] dsts,
                                                          int offset,
                                                          int length)
                                                   throws javax.net.ssl.SSLException
        Specified by:
        unwrap in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • wrap

        public final javax.net.ssl.SSLEngineResult wrap​(java.nio.ByteBuffer src,
                                                        java.nio.ByteBuffer dst)
                                                 throws javax.net.ssl.SSLException
        Overrides:
        wrap in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • unwrap

        public final javax.net.ssl.SSLEngineResult unwrap​(java.nio.ByteBuffer src,
                                                          java.nio.ByteBuffer dst)
                                                   throws javax.net.ssl.SSLException
        Overrides:
        unwrap in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • unwrap

        public final javax.net.ssl.SSLEngineResult unwrap​(java.nio.ByteBuffer src,
                                                          java.nio.ByteBuffer[] dsts)
                                                   throws javax.net.ssl.SSLException
        Overrides:
        unwrap in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • getDelegatedTask

        public final java.lang.Runnable getDelegatedTask()
        Specified by:
        getDelegatedTask in class javax.net.ssl.SSLEngine
      • closeInbound

        public final void closeInbound()
                                throws javax.net.ssl.SSLException
        Specified by:
        closeInbound in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • isInboundDone

        public final boolean isInboundDone()
        Specified by:
        isInboundDone in class javax.net.ssl.SSLEngine
      • closeOutbound

        public final void closeOutbound()
        Specified by:
        closeOutbound in class javax.net.ssl.SSLEngine
      • isOutboundDone

        public final boolean isOutboundDone()
        Specified by:
        isOutboundDone in class javax.net.ssl.SSLEngine
      • getSupportedCipherSuites

        public final java.lang.String[] getSupportedCipherSuites()
        Specified by:
        getSupportedCipherSuites in class javax.net.ssl.SSLEngine
      • getEnabledCipherSuites

        public final java.lang.String[] getEnabledCipherSuites()
        Specified by:
        getEnabledCipherSuites in class javax.net.ssl.SSLEngine
      • setEnabledCipherSuites

        public final void setEnabledCipherSuites​(java.lang.String[] cipherSuites)
        Specified by:
        setEnabledCipherSuites in class javax.net.ssl.SSLEngine
      • getSupportedProtocols

        public final java.lang.String[] getSupportedProtocols()
        Specified by:
        getSupportedProtocols in class javax.net.ssl.SSLEngine
      • getEnabledProtocols

        public final java.lang.String[] getEnabledProtocols()
        Specified by:
        getEnabledProtocols in class javax.net.ssl.SSLEngine
      • setEnabledProtocols

        public final void setEnabledProtocols​(java.lang.String[] protocols)
        TLS doesn't support a way to advertise non-contiguous versions from the client's perspective, and the client just advertises the max supported version. The TLS protocol also doesn't support all different combinations of discrete protocols, and instead assumes contiguous ranges. OpenSSL has some unexpected behavior (e.g. handshake failures) if non-contiguous protocols are used even where there is a compatible set of protocols and ciphers. For these reasons this method will determine the minimum protocol and the maximum protocol and enabled a contiguous range from [min protocol, max protocol] in OpenSSL.
        Specified by:
        setEnabledProtocols in class javax.net.ssl.SSLEngine
      • getSession

        public final javax.net.ssl.SSLSession getSession()
        Specified by:
        getSession in class javax.net.ssl.SSLEngine
      • beginHandshake

        public final void beginHandshake()
                                  throws javax.net.ssl.SSLException
        Specified by:
        beginHandshake in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • getHandshakeStatus

        public final javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus()
        Specified by:
        getHandshakeStatus in class javax.net.ssl.SSLEngine
      • setUseClientMode

        public final void setUseClientMode​(boolean clientMode)
        Specified by:
        setUseClientMode in class javax.net.ssl.SSLEngine
      • getUseClientMode

        public final boolean getUseClientMode()
        Specified by:
        getUseClientMode in class javax.net.ssl.SSLEngine
      • setNeedClientAuth

        public final void setNeedClientAuth​(boolean b)
        Specified by:
        setNeedClientAuth in class javax.net.ssl.SSLEngine
      • getNeedClientAuth

        public final boolean getNeedClientAuth()
        Specified by:
        getNeedClientAuth in class javax.net.ssl.SSLEngine
      • setWantClientAuth

        public final void setWantClientAuth​(boolean b)
        Specified by:
        setWantClientAuth in class javax.net.ssl.SSLEngine
      • getWantClientAuth

        public final boolean getWantClientAuth()
        Specified by:
        getWantClientAuth in class javax.net.ssl.SSLEngine
      • setVerify

        @UnstableApi
        public final void setVerify​(int verifyMode,
                                    int depth)
        See SSL_set_verify and SSL.setVerify(long, int, int).
      • setEnableSessionCreation

        public final void setEnableSessionCreation​(boolean b)
        Specified by:
        setEnableSessionCreation in class javax.net.ssl.SSLEngine
      • getEnableSessionCreation

        public final boolean getEnableSessionCreation()
        Specified by:
        getEnableSessionCreation in class javax.net.ssl.SSLEngine
      • getSSLParameters

        public final javax.net.ssl.SSLParameters getSSLParameters()
        Overrides:
        getSSLParameters in class javax.net.ssl.SSLEngine
      • setSSLParameters

        public final void setSSLParameters​(javax.net.ssl.SSLParameters sslParameters)
        Overrides:
        setSSLParameters in class javax.net.ssl.SSLEngine
      • getNegotiatedApplicationProtocol

        public java.lang.String getNegotiatedApplicationProtocol()