/** * @return when OpenSSL is available */ public static boolean isAvailable() { return OpenSsl.isAvailable(); }
private static SslProvider defaultProvider() { if (OpenSsl.isAvailable()) { return SslProvider.OPENSSL; } else { return SslProvider.JDK; } }
private static SslProvider defaultProvider() { if (OpenSsl.isAvailable()) { return SslProvider.OPENSSL; } else { return SslProvider.JDK; } }
private Builder sslProvider(SslProvider sslProvider) { if (sslProvider == SslProvider.OPENSSL) { if (!OpenSsl.isAvailable()) { throw new IllegalStateException("OpenSSL SSL Provider is not available"); } } this.sslProvider = sslProvider; return this; }
private SslProvider detectTlsProvider() { if (OpenSsl.isAvailable()) { LOG.debug("Using OpenSSL for Netty transports."); return SslProvider.OPENSSL; } else { LOG.debug("Using default Java TLS provider for Netty transports."); return SslProvider.JDK; } }
/** * Returns the version string of the used available OpenSSL library or {@code null} if {@link #isAvailable()} * returns {@code false}. */ public static String versionString() { return isAvailable() ? SSL.versionString() : null; }
private static int checkErrorCode(int errorCode) { // Call OpenSsl.isAvailable() to ensure we try to load the native lib as CertificateVerifier.isValid(...) // will depend on it. If loading fails we will just skip the validation. if (OpenSsl.isAvailable() && !CertificateVerifier.isValid(errorCode)) { throw new IllegalArgumentException("errorCode '" + errorCode + "' invalid, see https://www.openssl.org/docs/man1.0.2/apps/verify.html."); } return errorCode; } }
/** * Returns the version of the used available OpenSSL library or {@code -1} if {@link #isAvailable()} * returns {@code false}. */ public static int version() { return isAvailable() ? SSL.version() : -1; }
/** * Returns the version of the used available OpenSSL library or {@code -1} if {@link #isAvailable()} * returns {@code false}. */ public static int version() { return isAvailable() ? SSL.version() : -1; }
/** * Returns the version string of the used available OpenSSL library or {@code null} if {@link #isAvailable()} * returns {@code false}. */ public static String versionString() { return isAvailable() ? SSL.versionString() : null; }
private static int checkErrorCode(int errorCode) { // Call OpenSsl.isAvailable() to ensure we try to load the native lib as CertificateVerifier.isValid(...) // will depend on it. If loading fails we will just skip the validation. if (OpenSsl.isAvailable() && !CertificateVerifier.isValid(errorCode)) { throw new IllegalArgumentException("errorCode '" + errorCode + "' invalid, see https://www.openssl.org/docs/man1.0.2/apps/verify.html."); } return errorCode; } }
static boolean isOpenSslAvailable() { return PlatformDependent.bitMode() != 32 && OpenSsl.isAvailable(); }
public static SslProvider chooseSslProvider() { // Use openssl only if available and has ALPN support (ie. version > 1.0.2). SslProvider sslProvider; if (ALLOW_USE_OPENSSL.get() && OpenSsl.isAvailable() && OpenSsl.isAlpnSupported()) { sslProvider = SslProvider.OPENSSL; } else { sslProvider = SslProvider.JDK; } return sslProvider; }
@Override public List<String> get() { List<String> ciphers; if (OpenSsl.isAvailable()) { // TODO: consider switching to the list of all available ciphers using OpenSsl.availableCipherSuites() ciphers = getBuiltInCipherList(); } else { ciphers = getEnabledJdkCipherSuites(); if (ciphers.isEmpty()) { // could not retrieve the list of enabled ciphers from the JDK SSLContext, so use the hard-coded list ciphers = getBuiltInCipherList(); } } return ciphers; } });
public static SslProvider chooseSslProvider() { // Use openssl only if available and has ALPN support (ie. version > 1.0.2). SslProvider sslProvider; if (ALLOW_USE_OPENSSL.get() && OpenSsl.isAvailable() && OpenSsl.isAlpnSupported()) { sslProvider = SslProvider.OPENSSL; } else { sslProvider = SslProvider.JDK; } return sslProvider; }
if (OpenSsl.isAvailable()) { log.info("Native SSL provider is available; will use native provider."); sslProvider = SslProvider.OPENSSL_REFCNT;
@Test public void testEnsureOpenSSLAvailability() { Assume.assumeTrue(allowOpenSSL); Assert.assertTrue(String.valueOf(OpenSsl.unavailabilityCause()), OpenSsl.isAvailable()); }
if (OpenSsl.isAvailable()) { log.info("Native SSL provider is available; will use native provider."); sslProvider = SslProvider.OPENSSL;
if (OpenSsl.isAvailable()) { provider = SslProvider.OPENSSL; LOGGER.info("Using OpenSSL provider");
engineOptions = new JdkSSLEngineOptions(); } else if (engineOptions instanceof OpenSSLEngineOptions) { if (!OpenSsl.isAvailable()) { VertxException ex = new VertxException("OpenSSL is not available"); Throwable cause = OpenSsl.unavailabilityCause();