错误信息:
javax.net.ssl.SSLException: Certificate for <localhost> doesn't match any of the subject alternative names: [xxxxxxx.xxx.xxxxxx.xxx]
我有一个运行在本地计算机的Spring Boot应用程序。我也通过putty建立了一个ssh隧道到服务器。
我已经完成以下步骤:
- 我手动创建/导入了所有方式的密钥/证书。
- 我使用-keytool中的-ext选项将dns地址和localhost添加到SAN中。
- 我还使用了一个开源的Java文件来安装证书。
- 我更改了hosts文件以将其设置为: 127.0.0.1 xxx.xxx.xxxxxxx.xxx(如果我ping DNS名称,则响应本地主机地址)。
- 我使用VM参数-Djavax.net.debug=ssl来检查证书是否正确加载。
我还需要什么?顺便说一下,我还在使用VPN。