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

项目:hono    文件:ConnectionFactoryImpl.java   
private void addTlsTrustOptions(final ProtonClientOptions clientOptions) {

        if (config.isTlsEnabled()) {
            clientOptions.setSsl(true);
        }

        if (clientOptions.getTrustOptions() == null) {
            TrustOptions trustOptions = config.getTrustOptions();
            if (trustOptions != null) {
                clientOptions.setSsl(true).setTrustOptions(trustOptions);
            }
        }

        if (clientOptions.isSsl()) {
            if (config.isHostnameVerificationRequired()) {
                clientOptions.setHostnameVerificationAlgorithm("HTTPS");
            } else {
                clientOptions.setHostnameVerificationAlgorithm("");
            }
        }
    }
项目:hono    文件:AbstractServiceBase.java   
/**
 * Copies TLS trust store configuration to a given set of server options.
 * <p>
 * The trust store configuration is taken from <em>config</em> and will
 * be added only if the <em>ssl</em> flag is set on the given server options.
 * 
 * @param serverOptions The options to add configuration to.
 */
protected final void addTlsTrustOptions(final NetServerOptions serverOptions) {

    if (serverOptions.isSsl() && serverOptions.getTrustOptions() == null) {

        TrustOptions trustOptions = getConfig().getTrustOptions();
        if (trustOptions != null) {
            serverOptions.setTrustOptions(trustOptions).setClientAuth(ClientAuth.REQUEST);
            LOG.info("enabling TLS for client authentication");
        }
    }
}
项目:hono    文件:AbstractConfig.java   
/**
 * Gets the trust options derived from the trust store properties.
 * 
 * @return The trust options or {@code null} if trust store path is not set or not supported.
 */
public final TrustOptions getTrustOptions() {

    if (trustStorePath == null) {
        return null;
    }

    final FileFormat format = FileFormat.orDetect(trustStoreFormat, trustStorePath);

    if (format == null) {
        LOG.debug("unsupported trust store format");
        return null;
    }

    switch (format) {
    case PEM:
        LOG.debug("using certificates from file [{}] as trust anchor", trustStorePath);
        return new PemTrustOptions().addCertPath(trustStorePath);
    case PKCS12:
        LOG.debug("using certificates from PKCS12 key store [{}] as trust anchor", trustStorePath);
        return new PfxOptions()
                .setPath(getTrustStorePath())
                .setPassword(getTrustStorePassword());
    case JKS:
        LOG.debug("using certificates from JKS key store [{}] as trust anchor", trustStorePath);
        return new JksOptions()
                .setPath(getTrustStorePath())
                .setPassword(getTrustStorePassword());
    default:
        LOG.debug("unsupported trust store format: {}", format);
        return null;
    }
}
项目:reactive-pg-client    文件:PgConnectOptions.java   
@Override
public PgConnectOptions setTrustOptions(TrustOptions options) {
  return (PgConnectOptions)super.setTrustOptions(options);
}
项目:chili-core    文件:TrustAndKeyProvider.java   
public TrustAndKeyProvider(TrustOptions trust, KeyCertOptions keyCert) {
    this.trust = trust;
    this.keyCert = keyCert;
}
项目:chili-core    文件:TrustAndKeyProvider.java   
/**
 * @return trust options for the wrapped provider implementation.
 */
public TrustOptions trustOptions() {
    return trust;
}
项目:vertx-mqtt    文件:MqttServerOptions.java   
@Override
public MqttServerOptions setTrustOptions(TrustOptions options) {
  super.setTrustOptions(options);
  return this;
}
项目:vertx-mqtt    文件:MqttClientOptions.java   
@Override
public MqttClientOptions setTrustOptions(TrustOptions options) {
   super.setTrustOptions(options);
   return this;
}
项目:vertx-amqp-bridge    文件:AmqpBridgeOptions.java   
@Override
public AmqpBridgeOptions setTrustOptions(TrustOptions options) {
  super.setTrustOptions(options);
  return this;
}
项目:vertx-proton    文件:ProtonServerOptions.java   
@Override
public ProtonServerOptions setTrustOptions(TrustOptions options) {
  super.setTrustOptions(options);
  return this;
}
项目:vertx-proton    文件:ProtonClientOptions.java   
@Override
public ProtonClientOptions setTrustOptions(TrustOptions options) {
  super.setTrustOptions(options);
  return this;
}
项目:vertx-web    文件:WebClientOptions.java   
@Override
public WebClientOptions setTrustOptions(TrustOptions options) {
  return (WebClientOptions) super.setTrustOptions(options);
}