### Question:
TransportSupport { public static SslHandler createSslHandler(ByteBufAllocator allocator, URI remote, TransportOptions options) throws Exception { final SSLEngine sslEngine; if (isOpenSSLPossible(options)) { SslContext sslContext = createOpenSslContext(options); sslEngine = createOpenSslEngine(allocator, remote, sslContext, options); } else { SSLContext sslContext = options.getSslContextOverride(); if (sslContext == null) { sslContext = createJdkSslContext(options); } sslEngine = createJdkSslEngine(remote, sslContext, options); } return new SslHandler(sslEngine); }  static boolean isOpenSSLPossible(TransportOptions options); static SslHandler createSslHandler(ByteBufAllocator allocator, URI remote, TransportOptions options); static SSLContext createJdkSslContext(TransportOptions options); static SSLEngine createJdkSslEngine(URI remote, SSLContext context, TransportOptions options); static SslContext createOpenSslContext(TransportOptions options); static SSLEngine createOpenSslEngine(ByteBufAllocator allocator, URI remote, SslContext context, TransportOptions options);  }### Answer:
@Test(timeout = 100000) public void testCreateSslHandlerJDK() throws Exception { assumeTrue(OpenSsl.isAvailable()); assumeTrue(OpenSsl.supportsKeyManagerFactory()); TransportOptions options = new TransportOptions(); options.setUseOpenSSL(false); SslHandler handler = TransportSupport.createSslHandler(null, null, options); assertNotNull(handler); assertFalse(handler.engine() instanceof OpenSslEngine); }
@Test(timeout = 100000) public void testCreateSslHandlerOpenSSL() throws Exception { assumeTrue(OpenSsl.isAvailable()); assumeTrue(OpenSsl.supportsKeyManagerFactory()); TransportOptions options = new TransportOptions(); options.setUseOpenSSL(true); SslHandler handler = TransportSupport.createSslHandler(PooledByteBufAllocator.DEFAULT, null, options); assertNotNull(handler); assertTrue(handler.engine() instanceof OpenSslEngine); }