我正在运行一个独立的Wiremock实例,用于在JUnit测试中模拟。如果我将wiremock自签名证书与开关--https-port 8443一起使用,这在http上工作得很好。但是,如果我指定--https-keystore server_keystore.jks,任何与Wiremock通信的尝试都会抛出一个javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake。在浏览器中连接到管理页面https://localhost:9093/__admin/时,会显示关于连接正在关闭的类似错误。
密钥库的生成方式如下;
keytool -genkey -keyalg RSA -keysize 2048 -alias server -keypass secret -storepass secret -keystore server_keystore.jks如果我为Wiremock中的所有流量启用日志记录,我会看到;
Problem decoding network traffic
java.nio.charset.MalformedInputException: Input length = 1在尝试与Wiremock通信之前,我在调用代码中添加了System.setProperty("javax.net.ssl.trustStore", "server_keystore.jks");,但没有成功。
发布于 2020-02-19 20:15:02
由于您已经在密钥库上设置了密码,因此需要通过--keystore-password参数将密码提供给WireMock。
https://stackoverflow.com/questions/60261503
复制相似问题