}
});
};
server.connectHandler(serverHandler).listen(ar -> {
client.close();
NetClientOptions clientOptions = new NetClientOptions();
if (!startTLS) {
clientOptions.setSsl(true);
if (clientTrustAll) {
clientOptions.setTrustAll(true);
}
if (clientTrust) {
clientOptions.setTrustStoreOptions(new JKSOptions().setPath(findFileOnClasspath("tls/client-truststore.jks")).setPassword("wibble"));
}
if (clientCert) {
clientOptions.setKeyStoreOptions(new JKSOptions().setPath(findFileOnClasspath("tls/client-keystore.jks")).setPassword("wibble"));
}
for (String suite: enabledCipherSuites) {
clientOptions.addEnabledCipherSuite(suite);
}
}
client = vertx.createNetClient(clientOptions);
client.connect(4043, "localhost", ar2 -> {
if (ar2.succeeded()) {