0

我想知道是否有任何方法可以将 netty socketio 配置为在 Spring-boot 应用程序中使用 https 而不是 http。我已经这样做了:

        Configuration config = new Configuration();
        config.setHostname("localhost");
        config.setPort(9999);
        config.setKeyStorePassword("password");
        InputStream stream = new FileInputStream("certificate/clientssl.jks");
        config.setKeyStore(stream);

与 clientssl.jks 我的密钥库。我已经创建了它,而且如果我在 REST 客户端中使用此证书,则 https 可以工作。

我得到了这个错误。

io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown

也许是我在 FileInputStream 中的路径错误?我的资源文件夹中有“clientssl.jks”。我曾尝试使用像“Users/.../resources/certificate/clientssl.jks”这样的绝对路径,但它没有用。

任何帮助,将不胜感激。如果您有更多详细信息,请告诉我。

PS:我在Windows上。

4

0 回答 0