⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sslhowto.txt

📁 acegi构造安全的java系统
💻 TXT
字号:
$Id: sslhowto.txt 2039 2007-09-05 12:08:49Z luke_t $CAS requires HTTPS be used for all operations, with the certificate usedhaving been signed by a certificate in the cacerts files shipped with Java.If you're using a HTTPS certificate signed by a well known authority(like Verisign), you can safely ignore the procedure below (although youmight find the troubleshooting section at the end helpful).The following demonstrates how to create a self-signed certificate and addit to the cacerts file. If you just want to use the certificate we havealready created and shipped with the Acegi Security System for Spring, youcan skip directly to step 3.1. keytool -keystore keystore -alias acegisecurity -genkey -keyalg RSA -validity 9999 -storepass password -keypass passwordWhat is your first and last name?  [Unknown]:  localhostWhat is the name of your organizational unit?  [Unknown]:  Acegi Security System for SpringWhat is the name of your organization?  [Unknown]:  TEST CERTIFICATE ONLY. DO NOT USE IN PRODUCTION.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=localhost, OU=Acegi Security System for Spring, O=TEST CERTIFICATE ONLY. DO NOT USE IN PRODUCTION., L=Unknown, ST=Unknown, C=Unknown correct?  [no]:  yes2. keytool -export -v -rfc -alias acegisecurity -file acegisecurity.txt -keystore keystore -storepass password3. copy acegisecurity.txt %JAVA_HOME%\lib\security   4. copy keystore %YOUR_WEB_CONTAINER_LOCATION%   NOTE: You will need to configure your web container as appropriate.   We recommend you test the certificate works by visiting   https://localhost:8443. When prompted by your browser, select to   install the certificate.5. cd %JAVA_HOME%\lib\security6. keytool -import -v -file acegisecurity.txt -keypass password -keystore cacerts -storepass changeit -alias acegisecurityOwner: CN=localhost, OU=Acegi Security System for Spring, O=TEST CERTIFICATE ONLY. DO NOT USE IN PRODUCTION., L=Unknown, ST=Unknown, C=UnknownIssuer: CN=localhost, OU=Acegi Security System for Spring, O=TEST CERTIFICATE ONLY. DO NOT USE IN PRODUCTION., L=Unknown, ST=Unknown, C=UnknownSerial number: 4080daf4Valid from: Sat Apr 17 07:21:24 GMT 2004 until: Tue Sep 02 07:21:24 GMT 2031Certificate fingerprints:         MD5:  B4:AC:A8:24:34:99:F1:A9:F8:1D:A5:6C:BF:0A:34:FA         SHA1: F1:E6:B1:3A:01:39:2D:CF:06:FA:82:AB:86:0D:77:9D:06:93:D6:B0Trust this certificate? [no]:  yesCertificate was added to keystore[Saving cacerts]7. Finished. You can now run the sample application as if you purchased a   properly signed certificate. For production applications, of course you should   use an appropriately signed certificate so your web visitors will trust it   (such as issued by Thawte, Verisign etc).TROUBLESHOOTING* First of all, most CAS-Acegi Security problems are because of untrusted  SSL certificates. So it's important to understand why. Most people can  load the Acegi Security webapp, get redirected to the CAS server, then  after login they get redirected back to the Acegi Security webapp and  receive a failure. This is because the CAS server redirects to something  like https://server3.company.com/webapp/j_acegi_cas_security_check?ticket=ST-0-ER94xMJmn6pha35CQRoZ  which causes the "service ticket" (the "ticket" parameter) to be validated.  net.sf.acegisecurity.providers.cas.ticketvalidator.CasProxyTicketValidator  performs service ticket validation by delegation to CAS'  ProxyTicketValidator class. The ProxyTicketValidator class will perform a  HTTPS connection from the web server running the Acegi Security webapp  (server3.company.com) above to the CAS server. If for some reason the  web server keystore does not trust the HTTPS certificate presented by the  CAS server, you will receive various failures as discussed below. NB: This  has NOTHING to do with client-side (browser) certificates. You need to  correct the trust between the two webserver keystores alone.* A "sun.security.validator.ValidatorException: No trusted certificate   found" indicates the cacerts is not being used or it did not correctly  import the certificate. To rule out your web container replacing or in  some way modifying the trust manager, set the  CasProxyTicketValidator.trustStore property to the full file system  location to your cacerts file.* If your web container is ignoring your cacerts file, double-check it  is stored in $JAVA_HOME\lib\security\cacerts. $JAVA_HOME might be  pointing to the SDK, not JRE. In that case, copy  $JAVA_HOME\jre\lib\security\cacerts to $JAVA_HOME\lib\security\cacerts

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -