2011-10-17 132 views
0

對所有人來說都是非常好的一天。使用tomcat配置SSL

我已經生成一個自簽名密鑰存儲文件和使用該

<Connector port=」8443″ 
maxThreads=」150″ minSpareThreads=」25″ maxSpareThreads=」75″ 
enableLookups=」true」 disableUploadTimeout=」true」 
acceptCount=」100″ debug=」0″ scheme=」https」 secure=」true」 
clientAuth=」false」 sslProtocol=」TLS」 
keystoreFile=」/webapps/techtracer.bin」 
keystorePass=」ttadmin」 /> 

其實我的鏈接訪問內部 一個Tomcat運行的應用程序將它添加到Tomcat正在使用該

http:localhost:8080/SpringEx/index.html 

但ssl certicate只適用於我這樣做

http:localhost:8443/SpringEx/index.html 

這種行爲是否正常?

謝謝。

回答

2

是的,這是正常的。但是,如果你想用一個更友好的鏈接訪問像https://localhost/SpringEx/index.html試試這個:

你可能有另一個連接器在你的server.xml

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

嘗試和redirectPort設置爲443,然後在使用443端口你的連接器也是。現在

<Connector port=」443″ 
    maxThreads=」150″ minSpareThreads=」25″ maxSpareThreads=」75″ 
    enableLookups=」true」 disableUploadTimeout=」true」 
    acceptCount=」100″ debug=」0″ scheme=」https」 secure=」true」 
    clientAuth=」false」 sslProtocol=」TLS」 
    keystoreFile=」/webapps/techtracer.bin」 
    keystorePass=」ttadmin」 /> 

,你應該能夠在https://localhost/SpringEx/index.html

+0

謝謝弗蘭克訪問服務。 – Pawan

+0

很高興能幫到你! – Paaske