为Tomcat6.0配置HTTPS

来源:互联网 发布:win10无法如何忘记网络 编辑:程序博客网 时间:2024/04/29 09:37

TOMCAT_HOME=C:/Program Files/Apache Software Foundation/Tomcat 6.0

JDK_HOME=C:/Program Files/Java/jdk1.5.0_11

 

 

 

-- Step 1: generate a key file --

 

C:/Program Files/Apache Software Foundation/Tomcat 6.0>

$JDK_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keypass changeit -storepass changeit -keystore server.keystore -validity 3600
What is your first and last name?
  [Unknown]:
What is the name of your organizational unit?
  [Unknown]:
What is the name of your organization?
  [Unknown]:
What is the name of your City or Locality?
  [Unknown]:
What is the name of your State or Province?
  [Unknown]:
What is the two-letter country code for this unit?
  [Unknown]:
Is CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?
  [no]:

 

 

-- Step 2: configure Tomcat --

open $TOMCAT_HOME/conf/server.xml

locate the section of somelike

    <Connector port="8443" protocol="HTTP/1.1"
               maxThreads="150"
               scheme="https" secure="true" SSLEnabled="true"
               clientAuth="false" sslProtocol="TLS"

 

     ...  />

 

change to

    <Connector port="8443" protocol="HTTP/1.1"
               maxThreads="150"
               scheme="https" secure="true" SSLEnabled="true"
               clientAuth="false" sslProtocol="TLS"
               keystoreFile="C:/Program Files/Apache Software Foundation/Tomcat 6.0/server.keystore"
               keystorePass="changeit" />

 

-- Step 3: restart Tomcat --

verify over: https://localhost:8443/

 

 

 

Please refer to follow address for openssl:

http://blog.igo-home.com/index.php/7/viewspace-845.html

 

原创粉丝点击