简体   繁体   中英

SSL : HTTP to HTTPS conversion error

I have generated the certificate and added to trust store using the below commands

keytool -genkey -alias CERT-ALIAS -keyalg RSA -keysize 2048  -validity 365 -keystore Certificate_Online
keytool -certreq -v -alias CERT-ALIAS -keystore Certificate_Online.jks -file Certificate_Online.csr
keytool  -export -alias CERT-ALIAS -file Certificate_Online.cer -keystore Certificate_Online

i modified my server.xml as below

server.xml:

<Connector  port="2222" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" 
keystoreFile="/jdk1.6.0_32/bin/Certificate_Online.jks" keystorePass="changeit" />

still when i try to open the link in the broswer it is showing This site can't be reached ,ip refused to connect. please help me out . tried a lot but could find where the problem is. thanks a lot in advance .

The reason that this is not working is that the certificate is not trusted. You generated a Certificate Signing Request, but it does not appear to have been signed (by a Certificate Authority).

In order to get around this for testing you can add your certificate to your own trusted certificate store. In Linux you should be able to do this by using the keytool -import command in your JRE. Something like this:

keytool -import -file /jdk1.6.0_32/bin/Certificate_Online.cer -alias CERT-ALIAS -keystore "/jre/lib/security/cacerts" -storepass changeit

In Windows you can double click on the .cer file, click "Install Certificate" and place the certificate in the "Trusted Root Certification Authorities" store.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM