/** * Returns the default server-side implementation provider currently in use. * * @return {@link SslProvider#OPENSSL} if OpenSSL is available. {@link SslProvider#JDK} otherwise. */ public static SslProvider defaultServerProvider() { if (OpenSsl.isAvailable()) { return SslProvider.OPENSSL; } else { return SslProvider.JDK; } }
/** * Creates a new instance * * @param sslCtx an OpenSSL {@code SSL_CTX} object * @param bufPool the {@link SslBufferPool} that will be used by this engine */ public OpenSslEngine(long sslCtx, SslBufferPool bufPool, String fallbackApplicationProtocol) { OpenSsl.ensureAvailability(); if (sslCtx == 0) { throw new NullPointerException("sslContext"); } if (bufPool == null) { throw new NullPointerException("bufPool"); } this.bufPool = bufPool; ssl = SSL.newSSL(sslCtx, true); networkBIO = SSL.makeNetworkBIO(ssl); this.fallbackApplicationProtocol = fallbackApplicationProtocol; }
OpenSsl.ensureAvailability();
provider = OpenSsl.isAvailable()? SslProvider.OPENSSL : SslProvider.JDK;