在深入研究我的问题时,解释了 atg gRpc with TLS Client Authentication using SunPKCS11 in netty failed,我更改了 netty-tcnative-boringssl 的版本。我的 build.gradle 中的 cange 来自
compile 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork26'
到
compile 'io.netty:netty-tcnative-boringssl-static:+'
导致:
+--- io.netty:netty-tcnative-boringssl-static:+ -> 2.0.1.Final
我这样做是因为根据 netty 的 javadocSslContextBuilder's
keyManager(KeyManagerFactory factory)
方法也适用于作为提供者的 OpenSSL,它不适用于版本 1.1.33.Fork26。
现在,在新版本中,netty 的 slf4j 调试输出告诉我:
[main] 调试 io.netty.handler.ssl.OpenSsl - netty-tcnative 不在类路径中;OpenSslEngine 将不可用
所以netty-tcnative的检测似乎失败了。调试到
io.netty.handler.ssl.OpenSsl
的静态代码块,检测失败,因为
Class.forName("org.apache.tomcat.jni.SSL", false, OpenSsl.class.getClassLoader());
抛出异常。我做错了什么,或者这是近年来问题的一些复苏(https://github.com/relayrides/pushy/issues/303和https://github.com/netty/netty-tcnative/issues/136) ? // 使用 Oracle Java 1.8.21 在 64 位 Win 10 上工作