java.security.InvalidAlgorithmParameterException:null

时间:2017-03-28 10:38:55

标签: java spring ssl tls1.2

尝试使用SSL证书运行Spring Boot应用程序时遇到此异常。该应用程序在Kubernetes内部作为Docker容器运行。

关键问题是对excpetion的描述是 null

有没有人遇到过这样的问题?

UPDATE1 - 我已在openjdk:8-jre-alpine上使用我的Dockerfile。我还原了 回到openjdk:8u111-jre-alpine并且错误消失了。我仍然不知道错误的原因是什么。

java.lang.RuntimeException: java.security.InvalidAlgorithmParameterException
        at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1476) ~[na:1.8.0_121]
        at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:535) ~[na:1.8.0_121]
        at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:813) ~[na:1.8.0_121]
        at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781) ~[na:1.8.0_121]
        at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624) ~[na:1.8.0_121]
        at org.apache.tomcat.util.net.SecureNioChannel.handshakeUnwrap(SecureNioChannel.java:459) ~[tomcat-embed-core-8.5.6.jar!/:8.5.6]
        at org.apache.tomcat.util.net.SecureNioChannel.handshake(SecureNioChannel.java:232) ~[tomcat-embed-core-8.5.6.jar!/:8.5.6]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1387) ~[tomcat-embed-core-8.5.6.jar!/:8.5.6]
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.6.jar!/:8.5.6]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.6.jar!/:8.5.6]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Caused by: java.security.ProviderException: java.security.InvalidAlgorithmParameterException
        at sun.security.ec.ECKeyPairGenerator.generateKeyPair(ECKeyPairGenerator.java:147) ~[sunec.jar:1.8.0_121]
        at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:703) ~[na:1.8.0_121]
        at sun.security.ssl.ECDHCrypt.<init>(ECDHCrypt.java:65) ~[na:1.8.0_121]
        at sun.security.ssl.ServerHandshaker.setupEphemeralECDHKeys(ServerHandshaker.java:1431) ~[na:1.8.0_121]
        at sun.security.ssl.ServerHandshaker.trySetCipherSuite(ServerHandshaker.java:1229) ~[na:1.8.0_121]
        at sun.security.ssl.ServerHandshaker.chooseCipherSuite(ServerHandshaker.java:1026) ~[na:1.8.0_121]
        at sun.security.ssl.ServerHandshaker.clientHello(ServerHandshaker.java:741) ~[na:1.8.0_121]
        at sun.security.ssl.ServerHandshaker.processMessage(ServerHandshaker.java:224) ~[na:1.8.0_121]
        at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026) ~[na:1.8.0_121]
        at sun.security.ssl.Handshaker$1.run(Handshaker.java:966) ~[na:1.8.0_121]
        at sun.security.ssl.Handshaker$1.run(Handshaker.java:963) ~[na:1.8.0_121]
        at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_121]
        at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1416) ~[na:1.8.0_121]
        at org.apache.tomcat.util.net.SecureNioChannel.tasks(SecureNioChannel.java:407) ~[tomcat-embed-core-8.5.6.jar!/:8.5.6]
        at org.apache.tomcat.util.net.SecureNioChannel.handshakeUnwrap(SecureNioChannel.java:467) ~[tomcat-embed-core-8.5.6.jar!/:8.5.6]
        ... 7 common frames omitted
Caused by: java.security.InvalidAlgorithmParameterException: null
        at sun.security.ec.ECKeyPairGenerator.generateECKeyPair(Native Method) ~[sunec.jar:1.8.0_121]
        at sun.security.ec.ECKeyPairGenerator.generateKeyPair(ECKeyPairGenerator.java:128) ~[sunec.jar:1.8.0_121]
        ... 21 common frames omitted

1 个答案:

答案 0 :(得分:1)

我在docker-openjdk的github上为此打开了一个问题,这似乎是支持的eliptic曲线的一个问题 的openjdk / JDK / SRC /共享/类/太阳/安全/ SSL / SupportedEllipticCurvesExtension.java

https://github.com/docker-library/openjdk/issues/115

修复程序合并到openjdk-alpine的8.131.11-r2