Java 类io.vertx.core.net.JdkSSLEngineOptions 实例源码

项目:vertx-acme4j    文件:SetupHttpServerOptions.java   
public static HttpServerOptions createHttpServerOptions(DynamicCertOptions dynamicCertOptions, boolean jettyAgentAlreadyLoaded) {
    HttpServerOptions httpOptions = new HttpServerOptions()
            // basic TCP/HTTP options
            .setReuseAddress(true)
            .setCompressionSupported(false) // otherwise it automatically compresses based on response headers even if pre-compressed with e.g. proxy
            .setUsePooledBuffers(true)
            .setSsl(true)
            .setKeyCertOptions(dynamicCertOptions)
            // TLS tuning
            .addEnabledSecureTransportProtocol("TLSv1.2")
            .addEnabledSecureTransportProtocol("TLSv1.3");

    // enable HTTP/2 support if we can..
    if (USE_OPENSSL) {
        // TODO this has not really been tested with SNI yet
        httpOptions
                .setUseAlpn(true)
                .setSslEngineOptions(new OpenSSLEngineOptions());
        cipherSuites.stream().map(SetupHttpServerOptions::javaCipherNameToOpenSSLName)
                .forEach(httpOptions::addEnabledCipherSuite);
    } else {
        httpOptions
                .setUseAlpn(jettyAgentAlreadyLoaded || DynamicAgent.enableJettyAlpn())
                .setJdkSslEngineOptions(new JdkSSLEngineOptions());
        cipherSuites.forEach(httpOptions::addEnabledCipherSuite);
    }

    return httpOptions;
}
项目:apiman    文件:HttpsGatewayVerticle.java   
@Override
public void start(Future<Void> startFuture) {
    super.start(startFuture);

    HttpApiFactory.init(engine.getApiRequestPathParser());

    InheritingHttpServerOptions httpsServerOptions = new InheritingHttpServerOptions();
    httpsServerOptions
        .setSsl(true)
        .setKeyStoreOptions(
                new JksOptions()
                    .setPath(apimanConfig.getKeyStore())
                    .setPassword(apimanConfig.getKeyStorePassword())
                )
        .setTrustStoreOptions(
                new JksOptions()
                    .setPath(apimanConfig.getTrustStore())
                    .setPassword(apimanConfig.getTrustStorePassword())
                );

    if (JdkSSLEngineOptions.isAlpnAvailable()) {
        httpsServerOptions.setUseAlpn(true);
    }

    // Load any provided configuration into the HttpServerOptions.
    JsonObject httpServerOptionsJson = apimanConfig.getVerticleConfig(verticleType().name())
            .getJsonObject("httpServerOptions", new JsonObject()); //$NON-NLS-1$
    InheritingHttpServerOptionsConverter.fromJson(httpServerOptionsJson, httpsServerOptions);

    vertx.createHttpServer(httpsServerOptions)
        .requestHandler(this::requestHandler)
        .listen(apimanConfig.getPort(VERTICLE_TYPE),
                apimanConfig.getHostname());
}
项目:apiman    文件:HttpClientComponentImpl.java   
public HttpClientComponentImpl(Vertx vertx, VertxEngineConfig engineConfig, Map<String, String> componentConfig) {
    HttpClientOptions sslOptions = new HttpClientOptions()
            .setSsl(true)
            .setVerifyHost(false)
            .setTrustAll(true); // TODO

    if (JdkSSLEngineOptions.isAlpnAvailable()) {
        sslOptions.setUseAlpn(true);
    }

    this.sslClient = vertx.createHttpClient(sslOptions);
    this.plainClient = vertx.createHttpClient(new HttpClientOptions());
}
项目:apiman    文件:EchoServerVertx.java   
private HttpServerOptions getHttpServerOptions(String name) {
    HttpServerOptions options = new HttpServerOptions();
    HttpServerOptionsConverter.fromJson(config().getJsonObject(name, new JsonObject()), options);
    if (JdkSSLEngineOptions.isAlpnAvailable()) {
        options.setUseAlpn(true);
    }
    return options;
}
项目:reactive-pg-client    文件:PgConnectOptions.java   
@Override
public PgConnectOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) {
  return (PgConnectOptions)super.setJdkSslEngineOptions(sslEngineOptions);
}
项目:vertx-amqp-bridge    文件:AmqpBridgeOptions.java   
@Override
public AmqpBridgeOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) {
  super.setJdkSslEngineOptions(sslEngineOptions);
  return this;
}
项目:vertx-proton    文件:ProtonServerOptions.java   
@Override
public ProtonServerOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) {
  super.setJdkSslEngineOptions(sslEngineOptions);
  return this;
}
项目:vertx-proton    文件:ProtonClientOptions.java   
@Override
public ProtonClientOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) {
  super.setJdkSslEngineOptions(sslEngineOptions);
  return this;
}
项目:vertx-web    文件:WebClientOptions.java   
@Override
public WebClientOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) {
  return (WebClientOptions) super.setJdkSslEngineOptions(sslEngineOptions);
}