Configure SSL for Tomcat (one-way authentication)

Source: Internet
Author: User

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.

  1. @ Echo off
  2. Echo.
  3. Echo One-Way SSL verification tomcat_home/CONF/server. xml file configuration example
  4. Echo.
  5. Echo my blog: Ht ^ TP: // blog.csdn.net/sunyujia/
  6. Echo.
  7. Echo ^ & lt; connector Port = "443"
  8. Echo protocol = "HTTP/1.1"
  9. Echo sslenabled = "true"
  10. Echo maxthreads = "150"
  11. Echo scheme = "HTTPS"
  12. Echo secure = "true"
  13. Echo clientauth = "false"
  14. Echo sslprotocol = "TLS"
  15. Echo enablelookups = "false"
  16. Echo keystorepass = "password"
  17. Echo keystorefile = "tomcat. keystore"
  18. Echo usebodyencodingforuri = "true"/^>
  19. Echo.
  20. Generate tomcat. keystore to atat_home under ECHO
  21. Echo.
  22. Echo set shell = Createobject ("Shell. Application")> TMP. vbs
  23. Echo set selfolder = shell. browseforfolder (0, "select Tomcat directory http://blog.csdn.net/sunyujia/", 0, ssfdrives)> TMP. vbs
  24. Echo set selfolderitem = selfolder. Self> TMP. vbs
  25. Echo wscript. Echo selfolderitem. Path> TMP. vbs
  26. Echo.
  27. For/F "delims =" % I in ('cscript/nologo TMP. vbs ') do set tomcat_home = % I
  28. Echo.
  29. Del TMP. vbs
  30. 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.
  31. Input y to check whether the information is correct during echo input.
  32. Echo.
  33. If exist tomcat. keystore (DEL tomcat. keystore)
  34. Keytool-genkey-alias tomcat-keyalg RSA-keysize 1024-validity 3650-keystore tomcat. keystore
  35. Echo.
  36. ECHO file generated
  37. Echo.
  38. Echo moved tomcat. keystore in the current directory to % tomcat_home %
  39. Move tomcat. keystore "% tomcat_home %/tomcat. keystore"
  40. Echo.
  41. Pause

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.