server:
HttpServerOptions options = new HttpServerOptions()
.setSsl(true)
.setClientAuth(ClientAuth.REQUIRED)
.setPemKeyCertOptions(new PemKeyCertOptions().addCertPath(path+"/cert.pem").setKeyPath(path+"/key.pem"))
;
HttpServer server = vertx.createHttpServer(options);
client:
WebClientOptions options = new WebClientOptions()
.setSsl(true)
.setPemKeyCertOptions(new PemKeyCertOptions().addCertPath(path+"/cert.pem").setKeyPath(path+"/key.pem"))
.setTrustAll(true);
WebClient client = WebClient.create(vertx, options);
when invoking the client the server shows the error:
javax.net.ssl.SSLHandshakeException: Empty client certificate chain
which, i assume, indicates that the client is not sending the certificate to the server. Question: how do you implement mtls with vertx WebClient ?
adding:
to client and server options seems to solve the issue.
any comments, explanations why are welcome.