我正在为这段代码获取“ javax.net.ssl.SSLException:连接重置”

ReadableByteChannel rbc = Channels.newChannel(url.getInputStream());


但是只有在使用Open JDK 14的jlink构建的Java 14 JRE下运行时,如果我指向完整的JDK,代码就可以很好地执行。我怀疑JRE中缺少某些内容,但是它是什么?为什么jlink不会复制丢失的文件?我基于jdeps的jlink命令如下:

"C:\Program Files\Java\jdk-14\bin\jlink.exe" --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base,java.datatransfer,java.desktop,java.logging,java.xml --output %AG14InstallDir%\jre_windows2


我是否在jlink中缺少模块?关于如何进行追踪的任何想法或建议?

按照建议添加调试后,得到此输出。我需要复制什么来解决它?

javax.net.ssl|WARNING|2E|Thread-13|2020-06-07 10:22:24.517 UTC|null:-1|Signature algorithm, ed25519, is not supported by the underlying providers
javax.net.ssl|WARNING|2E|Thread-13|2020-06-07 10:22:24.518 UTC|null:-1|Signature algorithm, ed448, is not supported by the underlying providers
javax.net.ssl|WARNING|2E|Thread-13|2020-06-07 10:22:24.519 UTC|null:-1|No AlgorithmParameters for x25519 (
"throwable" : {
  java.security.NoSuchAlgorithmException: Algorithm x25519 not available
    at java.base/javax.crypto.KeyAgreement.getInstance(Unknown Source)
    at java.base/sun.security.ssl.NamedGroup.<init>(Unknown Source)
    at java.base/sun.security.ssl.NamedGroup.<clinit>(Unknown Source)
    at java.base/sun.security.ssl.SignatureScheme.<clinit>(Unknown Source)
    at java.base/sun.security.ssl.SSLSessionImpl.<clinit>(Unknown Source)
    at java.base/sun.security.ssl.TransportContext.<init>(Unknown Source)
    at java.base/sun.security.ssl.TransportContext.<init>(Unknown Source)
    at java.base/sun.security.ssl.SSLSocketImpl.<init>(Unknown Source)
    at java.base/sun.security.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
    at java.base/sun.net.www.protocol.https.HttpsClient.createSocket(Unknown Source)
    .............

最佳答案

解决了。需要将jdk.crypto.cryptoki添加到jlink的--add-modules列表中。

10-07 18:11