1

Here's my code:

wireMockServer = new WireMockServer(wireMockConfig().httpsPort(8443).keystorePath("/Users/me/keystore.jks").keystorePassword("password"));
wireMockServer.start();

The problem is that when I'm trying to connect I'm getting:

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

It seems that WireMock operates on HTTP mode rather than on HTTPS mode.

Why?

IsaacLevon
  • 2,260
  • 4
  • 41
  • 83

1 Answers1

4

wiremock is running in https mode when you specify .httpsPort(8443). but the problem is, the library you are using to make https call is not trusting the ssl certificates.

There are multiple ways to do it. however you should make sure that you do this only in the testing environment but not in production. Here are few resources to disable ssl check.

https://stackoverflow.com/a/21257694/3892213

https://stackoverflow.com/a/2703233/3892213

best wishes
  • 5,789
  • 1
  • 34
  • 59