List of usage examples for io.vertx.pgclient SslMode VERIFY_CA
SslMode VERIFY_CA
To view the source code for io.vertx.pgclient SslMode VERIFY_CA.
Click Source Link
From source file:examples.PgClientExamples.java
License:Apache License
public void ex10(Vertx vertx) { PgConnectOptions options = new PgConnectOptions().setPort(5432).setHost("the-host").setDatabase("the-db") .setUser("user").setPassword("secret").setSslMode(SslMode.VERIFY_CA) .setPemTrustOptions(new PemTrustOptions().addCertPath("/path/to/cert.pem")); PgConnection.connect(vertx, options, res -> { if (res.succeeded()) { // Connected with SSL } else {/*from w ww . jav a 2 s . c om*/ System.out.println("Could not connect " + res.cause()); } }); }