2017-10-07 101 views
-1

在发布此问题之前,我搜索了很多搜索引擎,但没有一个解决方案适用于我。我想在8443上启动我的tomcat(Tomcat支持SSL或https)无法在SSL上启动tomcat

我创建密钥库

C:\>keytool -genkey -alias mkyong -keyalg RSA -keystore c:\mkyongkeystore 
Enter keystore password: 
Re-enter new password: 
What is your first and last name? 
    [Unknown]: Rahul Rode 
What is the name of your organizational unit? 
    [Unknown]: XY 
What is the name of your organization? 
    [Unknown]: XY 
What is the name of your City or Locality? 
    [Unknown]: Hyderabad 
What is the name of your State or Province? 
    [Unknown]: Telangana 
What is the two-letter country code for this unit? 
    [Unknown]: IN 
Is CN=Rahul Rode, OU=XY, O=XY, L=Hyderabad, ST=Telangana, C=IN correct? 
    [no]: y 

Enter key password for <mkyong> 
     (RETURN if same as keystore password): 
Re-enter new password: 

和我做的雄猫server.xml文件中的变化

<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/> 

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" 
     maxThreads="150" scheme="https" secure="true" 
     clientAuth="false" sslProtocol="TLS" 
    keystoreFile="c:\mkyongkeystore" 
    keystorePass="changeit" /> 

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/> 

这是我的局域网设置:

enter image description here

,我也关掉我的防火墙设置

enter image description here

并不会错误是:

enter image description here

+1

您是否在更改server.xml后重新启动了tomcat?日志文件中是否有错误信息? –

+0

另外使用TaskMgr或相当于确保Tomcat实际上正在运行,并且'netstat -ano'(或'-anb'提升,或从曾经是sysinternals的TCPView)确保它实际上正在侦听。一旦你解决了你将在cert中得到错误的错误名称的错误;字段'keytool'调用'名字和姓'实际上是CommonName,对于SSL/TLS服务器(尽管不是其他X.509应用程序),它必须与URL中的主机名匹配,在您的情况'localhost'中,除非设置了SubjectAltName你没有。 –

+0

@Denis Lukenich - 是的,我做了,不知道什么停止在8443上运行。 – Prateek

回答

-1

可以有多个原因无法访问HTTPS。为此请记住一些要点: 1:tomcat无法读取您生成的密钥库文件。给它一切权限。 2:端口8443应处于打开状态。