Configure Tomcat + OpenSSL on Windows platform

Source: Internet
Author: User
Tags cas documentation openssl

Turn from: http://www.javaeye.com/topic/78274

It's clear enough, I'll just pick it up right here. Because of the single sign-on system that configures CAs, you need to configure Tomcat SSL first, in the configuration of Tomcat SSL process, I configured the version is tomcat5.5.20, reference a lot of information, but found not, and then I changed to 5.5.9, the result is very smooth, I switched to a total of 4 major versions and found that the SSL configuration was really different, and now I'm going to record these configurations for the next reference. reference DocumentationKeytool guidelines for use: http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html TOMCAT-SSL Configuration Guide: http:// Tomcat.apache.org/tomcat-5.5-doc/ssl-howto.htmlConfiguration Process 1. Generate Server key:Switch to the directory%tomcat_home% on the command line, and enter the following command on the command line (jdk1.4 with the tools above): Keytool-genkey-alias tomcat-keyalg rsa-keypass Changeit- Storepass changeit-keystore server.keystore-validity 3600 username input domain name, such as localhost (development or test) or hostname.domainname (user owned domain name), All others are skipped with enter, finally confirmed, and the Server.keystore file will be generated under%tomcat_home%. Note: parameter-validity refers to the validity of the certificate (days), the default validity period is very short, only 90 days.2. In the certificate Trust Library of the JDK into which the certificate is imported:This step is not required for the SSL configuration of T Omcat, but it is required for CAS SSO, otherwise the following error occurs: Edu.yale.its.tp.cas.client.CASAuthenticationException:Unable to Validate Proxyticketvalidator ...  The import process is divided into 2 steps, the first step is to export the certificate, and the second step is to import to the certificate trust library, as follows: Keytool-export-trustcacerts-alias tomcat-file Server.cer-keystore Server.keystore-storepass Changeit keytool-import-trustcacerts-alias tomcat-file server.cer-keystore%JAVA_HOME%/JR E/lib/security/cacerts-storepass Changeit If you have a hint, enter Y. Other useful Keytool commands (lists all existing certificates in the Trust certificate library, removing a certificate from the Library): Keytool-list-v-keystore d:/sdks/jdk1.5.0_11/jre/lib/security/cacerts Keytool-delete-trustcacerts-alias Tomcat-keystore D:/sdks/jdk1.5.0_11/jre/lib/security/cacerts-storepass Changeit3. Configure Tomcat:Modify Tomcat's Conf/server.xml file. Find "<connector port=" 8443 "..." here. Remove the annotation and add the Keystorepass and Keystorefile properties. Tomcat4.1.34 configuration:<connector classname= "Org.apache.coyote.tomcat4.CoyoteConnector" port= "8443" enablelookups= "true" scheme= "https" secure= "true" "Acceptcount=" useurivalidationhack= "false" disableuploadtimeout= "true" clientauth= "false" sslprotocol= "TLS" keystorefile= "Server.keystore" keystorepass= "Changeit"/>Tomcat5.5.9 configuration:<connector port= "8443" maxhttpheadersize= "8192"

maxthreads= "minsparethreads= " "maxsparethreads="

enablelookups= "false" disableuploadtimeout= "true"

acceptcount= "scheme=" "https" secure= "true"

clientauth= "false" sslprotocol= "TLS"

keystorefile= "Server.keystore"

keystorepass= "Changeit"/>

Tomcat5.5.20 configuration (This configuration can also be used for Tomcat6.0):

<connector protocol= "Org.apache.coyote.http11.Http11Protocol"

port= "8443" maxhttpheadersize= "8192"

maxthreads= "minsparethreads= " "maxsparethreads="

enablelookups= "false" disableuploadtimeout= "true"

acceptcount= "scheme=" "https" secure= "true"

clientauth= "false" sslprotocol= "TLS"

keystorefile= "Server.keystore" keystorepass= "Changeit"/>

Tomcat6.0.10 configuration:
<connector protocol= "Org.apache.coyote.http11.Http11NioProtocol"

port= "8443" minsparethreads= "5" maxsparethreads= "a"

enablelookups= "true" disableuploadtimeout= "true"

acceptcount= "maxthreads= "

scheme= "https" secure= "true" sslenabled= "true "

clientauth= "false" sslprotocol= "TLS"

keystorefile= "D:/tools/apache-tomcat-6.0.10/server.keystore"

keystorepass= "Changeit"/>

TOMCAT6 supports 3 types, please refer to the following documentation:

Http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html

Verifying Configuration Access https://localhost:8443/

Related Article

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.