Example usage for io.vertx.core.net NetClientOptions setSsl

List of usage examples for io.vertx.core.net NetClientOptions setSsl

Introduction

In this page you can find the example usage for io.vertx.core.net NetClientOptions setSsl.

Prototype

@Override
    public NetClientOptions setSsl(boolean ssl) 

Source Link

Usage

From source file:io.reactiverse.pgclient.impl.PgConnectionFactory.java

License:Apache License

public PgConnectionFactory(Context context, boolean registerCloseHook, PgConnectOptions options) {

    hook = this::close;
    this.registerCloseHook = registerCloseHook;

    ctx = context;//from   w w  w .  j  a  v  a2s  . c om
    if (registerCloseHook) {
        ctx.addCloseHook(hook);
    }

    NetClientOptions netClientOptions = new NetClientOptions(options);

    // Make sure ssl=false as we will use STARTLS
    netClientOptions.setSsl(false);

    this.sslMode = options.getSslMode();
    this.hostnameVerificationAlgorithm = netClientOptions.getHostnameVerificationAlgorithm();
    this.trustOptions = netClientOptions.getTrustOptions();
    this.host = options.getHost();
    this.port = options.getPort();
    this.database = options.getDatabase();
    this.username = options.getUser();
    this.password = options.getPassword();
    this.cachePreparedStatements = options.getCachePreparedStatements();
    this.pipeliningLimit = options.getPipeliningLimit();
    this.isUsingDomainSocket = options.isUsingDomainSocket();

    this.client = context.owner().createNetClient(netClientOptions);
}