gpt4 book ai didi

java.lang.RuntimeException : Could not generate dummy secret at sun. 安全.ssl.RSAClientKeyExchange.

转载 作者:太空宇宙 更新时间:2023-11-03 13:25:27 24 4
gpt4 key购买 nike

我正在开发 Java EE 应用程序(Netbeans IDE 8.0.2、Glassfish 4.1、JDK 1.8.0_45)。

对应用程序页面的访问应该通过 https 进行保护,所以我修改了我的 web.xml:

<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<description/>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

当我通过 Netbeans 部署和启动 Glassfish 时,我可以通过

访问我的应用程序
https://localhost:8181/MyApp/

当我将我的应用程序捆绑在一个 .war 文件中并手动将其部署到 netbeans 使用的相同 glassfish 安装文件的副本时,我在尝试连接到该应用程序时遇到异常:

    WARNING (35) GRIZZLY0013: Exception during FilterChain execution
java.lang.RuntimeException: Could not generate dummy secret
at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1429)
at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:535)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:813)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at org.glassfish.grizzly.ssl.SSLConnectionContext.unwrap(SSLConnectionContext.java:172)
at org.glassfish.grizzly.ssl.SSLUtils.handshakeUnwrap(SSLUtils.java:263)
at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:603)
at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:552)
at org.glassfish.grizzly.ssl.SSLBaseFilter.handleRead(SSLBaseFilter.java:273)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Could not generate dummy secret
at sun.security.ssl.RSAClientKeyExchange.<init>(RSAClientKeyExchange.java:132)
at sun.security.ssl.ServerHandshaker.processMessage(ServerHandshaker.java:238)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
at sun.security.ssl.Handshaker$1.run(Handshaker.java:919)
at sun.security.ssl.Handshaker$1.run(Handshaker.java:916)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1369)
at org.glassfish.grizzly.ssl.SSLUtils.executeDelegatedTask(SSLUtils.java:247)
at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:638)
... 16 more
Caused by: java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/ECB/PKCS1Padding
at javax.crypto.Cipher.getInstance(Cipher.java:540)
at sun.security.ssl.JsseJce.getCipher(JsseJce.java:229)
at sun.security.ssl.RSAClientKeyExchange.<init>(RSAClientKeyExchange.java:115)
... 24 more

如果我在 web.xml 中没有 CONFIDENTIAL 传输保证的情况下重复手动部署过程 (.war),我可以在

上访问我的应用程序
http://localhost:8080/MyApp/

我做错了什么? Netbeans 纠正了我手动做错了什么?

最佳答案

当我尝试将我的 glassfish 4.1.1 域切换到自定义 JVM 时,我遇到了同样的问题。我更新了 domain.xml - 这导致了类似的 Stacktrace。

我通过重置 domain.xml(不再指定特定的 JVM 或 java home)解决了这个问题,并在 glassfish\config 中配置了 AS_JAVA\asenv.bat 像这样:

SET AS_JAVA=C:\Program Files\Java\...

关于java.lang.RuntimeException : Could not generate dummy secret at sun. 安全.ssl.RSAClientKeyExchange.<init>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33465361/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com