Tomcat set HTTPS access

Source: Internet
Author: User

Section1Step: BuildServer Key:

%tomcat_home% command command line enter the following command ( jdk1.4 above with tools):  

Keytool-genkey-alias tomcat-keyalg rsa-keypass changeit-storepass changeit-keystore server.keystore-validity 3600

User name Enter the domain name, such aslocalhost(for development or testing) orHostname.domainname (user-owned domain name), all other toEnterSkip, Final confirmation, at which point the%tomcat_home%under BuildServer.keystorefile

Note: Parameters -validity refers to the validity period of a certificate ( days ) , the default validity period is very short, only - days.

2.Import the certificate into theJDKin the certificate trust Library:

This step for tomcat ssl configuration is not required, but for cas SSO is required, otherwise the following error will occur: edu.yale.its.tp.cas.client.casauthenticationexception: unable to validate  Proxyticketvalidator ...

The import process is divided into 2 Step , the first step is to export the certificate, and the second step is to import the certificate Truststore to the following command:

Keytool-export-trustcacerts-alias tomcat-file Server.cer-keystore Server.keystore-storepass Changeit

Keytool-import-trustcacerts-alias tomcat-file Server.cer-keystore%java_home%/jre/lib/security/cacerts-storepass C Hangeit

If prompted, enter Y you can do it.

Other Useful Keytool command (list all existing certificates in the trust certificate store and delete a certificate in 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 Changeit

3.ConfigurationTOMCAT:

write the following code in the E:\tomcat\tomcat1\conf\server.xml file

<connector port= "8443" protocol= "Org.apache.coyote.http11.Http11NioProtocol" sslenabled= "true"

               maxthreads= "Scheme=" HTTPS "secure=" true "

               Sslprotocol= "TLS"

                                keystorefile= "e:/ Tomcat/tomcat1/server.keystore "

                                keystorepass= "Changeit"/>

Tomcat set HTTPS access

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.