我在eclipse tomcat中设置了ssl认证。设置8443端口后工作正常,但现在当我尝试访问
http://localhost:8080/myapp/page.html
它不起作用。
如果没有ssl,我的应用程序工作正常,我需要在支持https的环境中运行代码,但代码应该使用8080端口。
这两个URL应该并行工作
https://localhost:8443/readapp/multiHostDeviceInfo.html?host=xyz¶m=device&intl=1
使用此命令创建的密钥
keytool -genkey -alias localhost -keyalg RSA -keystore /Users/name/Documents/keystore.keystore
我把这个放在我的服务器上。xml
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLSv1"
keystoreFile="/Users/myName/Documents/keystore.keystore"
keystorePass="password" />
打开项目时出现错误
java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:422)
我使用以下命令将其添加到java证书中
keytool -import -noprompt -trustcacerts -alias <AliasName> -file <certificate> -keystore <KeystoreFile> -storepass <Password>
重新启动tomcat后,出现以下异常
java.lang.IllegalArgumentException: java.security.KeyStoreException: Cannot store non-PrivateKeys
这是我的密钥库文件
beat, 7 Mar, 2018, trustedCertEntry, Certificate fingerprint (SHA1): xyz
localhost, 7 Mar, 2018, PrivateKeyEntry, Certificate fingerprint (SHA1): xyz
2018年3月7日,trustedCertEntry,我删除了该节拍中的条目
然后我又回到了握手问题上。
谢谢