Reprinted please indicate the source:Http://blog.csdn.net/sunyujia/
Use OpenSSL to configure SSL for Tomcat (two-way authentication) See http://blog.csdn.net/sunyujia/archive/2008/10/05/3017405.aspx
One-way authentication is relatively simple and a batch processing can be done.
The reader can directly execute the following batch processing demo. bat.
- @ Echo off
- Echo.
- Echo One-Way SSL verification tomcat_home/CONF/server. xml file configuration example
- Echo.
- Echo my blog: Ht ^ TP: // blog.csdn.net/sunyujia/
- Echo.
- Echo ^ & lt; connector Port = "443"
- Echo protocol = "HTTP/1.1"
- Echo sslenabled = "true"
- Echo maxthreads = "150"
- Echo scheme = "HTTPS"
- Echo secure = "true"
- Echo clientauth = "false"
- Echo sslprotocol = "TLS"
- Echo enablelookups = "false"
- Echo keystorepass = "password"
- Echo keystorefile = "tomcat. keystore"
- Echo usebodyencodingforuri = "true"/^>
- Echo.
- Generate tomcat. keystore to atat_home under ECHO
- Echo.
- Echo set shell = Createobject ("Shell. Application")> TMP. vbs
- Echo set selfolder = shell. browseforfolder (0, "select Tomcat directory http://blog.csdn.net/sunyujia/", 0, ssfdrives)> TMP. vbs
- Echo set selfolderitem = selfolder. Self> TMP. vbs
- Echo wscript. Echo selfolderitem. Path> TMP. vbs
- Echo.
- For/F "delims =" % I in ('cscript/nologo TMP. vbs ') do set tomcat_home = % I
- Echo.
- Del TMP. vbs
- The echo password must be at least six characters. Later, ask if the master password is the same as the keystore password. Enter Y. The keystorepass option in the server. xml file to configure this password.
- Input y to check whether the information is correct during echo input.
- Echo.
- If exist tomcat. keystore (DEL tomcat. keystore)
- Keytool-genkey-alias tomcat-keyalg RSA-keysize 1024-validity 3650-keystore tomcat. keystore
- Echo.
- ECHO file generated
- Echo.
- Echo moved tomcat. keystore in the current directory to % tomcat_home %
- Move tomcat. keystore "% tomcat_home %/tomcat. keystore"
- Echo.
- Pause