Class OpenSSLContext

  • All Implemented Interfaces:
    SSLContext

    public class OpenSSLContext
    extends java.lang.Object
    implements SSLContext
    • Field Detail

      • cctx

        protected final long cctx
      • ctx

        protected final long ctx
    • Constructor Detail

      • OpenSSLContext

        public OpenSSLContext​(SSLHostConfigCertificate certificate,
                              java.util.List<java.lang.String> negotiableProtocols)
                       throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
    • Method Detail

      • getEnabledProtocol

        public java.lang.String getEnabledProtocol()
      • setEnabledProtocol

        public void setEnabledProtocol​(java.lang.String protocol)
      • checkConf

        protected static boolean checkConf​(OpenSSLConf conf,
                                           long cctx)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • applyConf

        protected static boolean applyConf​(OpenSSLConf conf,
                                           long cctx,
                                           long ctx)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • init

        public void init​(javax.net.ssl.KeyManager[] kms,
                         javax.net.ssl.TrustManager[] tms,
                         java.security.SecureRandom sr)
        Setup the SSL_CTX.
        Specified by:
        init in interface SSLContext
        Parameters:
        kms - Must contain a KeyManager of the type OpenSSLKeyManager
        tms - Must contain a TrustManager of the type X509TrustManager
        sr - Is not used for this implementation.
      • addCertificate

        public void addCertificate​(SSLHostConfigCertificate certificate)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getCertificateChain

        public java.security.cert.X509Certificate[] getCertificateChain​(java.lang.String alias)
        Specified by:
        getCertificateChain in interface SSLContext
      • getAcceptedIssuers

        public java.security.cert.X509Certificate[] getAcceptedIssuers()
        Specified by:
        getAcceptedIssuers in interface SSLContext
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable