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