public static SSLEngine createSslEngine(URI remote,SSLContext context,NettyTransportSslOptions options) throws Exception {
  SSLEngine engine=null;
  if (remote == null) {
    engine=context.createSSLEngine();
  }
 else {
    engine=context.createSSLEngine(remote.getHost(),remote.getPort());
  }
  engine.setEnabledProtocols(buildEnabledProtocols(engine,options));
  engine.setEnabledCipherSuites(buildEnabledCipherSuites(engine,options));
  engine.setUseClientMode(true);
  if (options.isVerifyHost()) {
    SSLParameters sslParameters=engine.getSSLParameters();
    sslParameters.setEndpointIdentificationAlgorithm("HTTPS");
    engine.setSSLParameters(sslParameters);
  }
  return engine;
}

public static SSLEngine createSslEngine ( URI remote , SSLContext context , NettyTransportSslOptions options ) throws Exception { SSLEngine engine = null ; if ( remote == null ) { engine = context . createSSLEngine ( ) ; } else { engine = context . createSSLEngine ( remote . getHost ( ) , remote . getPort ( ) ) ; } engine . setEnabledProtocols ( buildEnabledProtocols ( engine , options ) ) ; engine . setEnabledCipherSuites ( buildEnabledCipherSuites ( engine , options ) ) ; engine . setUseClientMode ( true ) ; if ( options . isVerifyHost ( ) ) { SSLParameters sslParameters = engine . getSSLParameters ( ) ; sslParameters . setEndpointIdentificationAlgorithm ( "HTTPS" ) ; engine . setSSLParameters ( sslParameters ) ; } return engine ; }
create a new sslengine instance in client mode from the given sslcontext and transportssloptions instances .
