gpt4 book ai didi

tomcat - ssl tomcat证书错误

转载 作者:行者123 更新时间:2023-11-28 21:46:49 24 4
gpt4 key购买 nike

我在 http://www.globalsign.com/support/install/install_tomcat.php 中执行了以下步骤,使用 server.xml 中的以下条目:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" 
keystoreFile="D:\Tomcat\ukdp.keystore" keystorePass="123456" keyAlias="ukdp"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />

但是在启动过程中出现如下异常:

SEVERE: Error initializing endpoint
java.io.IOException: Alias name ukdp does not identify a key entry
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:412)
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:378)
at

org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:125)
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:496)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:177)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1059)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:792)
at org.apache.catalina.startup.Catalina.load(Catalina.java:518)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
Mar 14, 2011 4:14:56 PM org.apache.catalina.startup.Catalina load

当我如下删除 keyAlias 条目时:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" 
keystoreFile="D:\Tomcat\ukdp.keystore" keystorePass="123456"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />

启动时出现如下异常:

SEVERE: Socket accept failed
java.net.SocketException: SSL handshake errorjavax.net.ssl.SSLException: No available certificate or key corresponds to the SSL cipher suites which are enabled.
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.acceptSocket(JSSESocketFactory.java:150)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)
at java.lang.Thread.run(Unknown Source)
Mar 14, 2011 4:20:31 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run
SEVERE: Socket accept failed
java.net.SocketException: SSL handshake errorjavax.net.ssl.SSLException: No available certificate or key corresponds to the SSL cipher suites which are enabled.
at org.apache.tomcat.util.net.jsse.JSSESocketFactory.acceptSocket(JSSESocketFactory.java:150)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)
at java.lang.Thread.run(Unknown Source)
Mar 14, 2011 4:20:31 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run
SEVERE: Socket accept failed

最佳答案

使用列出 keystore 中的所有内容

keytool -list -keystore D:\Tomcat\ukdp.keystore -storepass 123456

如果该条目不存在,您需要将其作为 PrivateKeyEntry 导入。如果它在那里,请查看它的类型是 PrivateKeyEntry 而不是 trustedCertEntry

如果类型是trustedCertEntry,想改,我查到的过程如下:

#Convert to the key type to pkcs12
openssl pkcs12 -export -inkey myserverkey.key -in myserver.crt -out tempstore.p12


#Import to keystore:
keytool -importkeystore -srckeystore tempstore.p12 -srcstoretype PKCS12 -destkeystore keystore.jks

#List:
keytool -list -v -keystore keystore.jks
#Note the alias, usually gets "1", we need to change it

#Change alias:
keytool -changealias -alias 1 -destalias mywantedkeyalias -keystore keystore.jks

随着 myserverkey.keymyserver.crtkeystore.jksmywantedkeyalias 的明显变化

关于tomcat - ssl tomcat证书错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5297867/

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