howto.txt 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. $Id$
  2. CAS requires HTTPS be used for all operations, with the certificate used
  3. having been signed by a certificate in the cacerts files shipped with Java.
  4. If you're using a HTTPS certificate signed by a well known authority
  5. (like Verisign), you can safely ignore the procedure below (although you
  6. might find the troubleshooting section at the end helpful).
  7. The following demonstrates how to create a self-signed certificate and add
  8. it to the cacerts file. If you just want to use the certificate we have
  9. already created and shipped with the Acegi Security System for Spring, you
  10. can skip directly to step 3.
  11. 1. keytool -keystore keystore -alias acegisecurity -genkey -keyalg RSA -validity 9999 -storepass password -keypass password
  12. What is your first and last name?
  13. [Unknown]: localhost
  14. What is the name of your organizational unit?
  15. [Unknown]: Acegi Security System for Spring
  16. What is the name of your organization?
  17. [Unknown]: TEST CERTIFICATE ONLY. DO NOT USE IN PRODUCTION.
  18. What is the name of your City or Locality?
  19. [Unknown]:
  20. What is the name of your State or Province?
  21. [Unknown]:
  22. What is the two-letter country code for this unit?
  23. [Unknown]:
  24. Is CN=localhost, OU=Acegi Security System for Spring, O=TEST CERTIFICATE ONLY. D
  25. O NOT USE IN PRODUCTION., L=Unknown, ST=Unknown, C=Unknown correct?
  26. [no]: yes
  27. 2. keytool -export -v -rfc -alias acegisecurity -file acegisecurity.txt -keystore keystore -storepass password
  28. 3. copy acegisecurity.txt %JAVA_HOME%\lib\security
  29. 4. copy keystore %YOUR_WEB_CONTAINER_LOCATION%
  30. NOTE: You will need to configure your web container as appropriate.
  31. We recommend you test the certificate works by visiting
  32. https://localhost:8443. When prompted by your browser, select to
  33. install the certificate.
  34. 5. cd %JAVA_HOME%\lib\security
  35. 6. keytool -import -v -file acegisecurity.txt -keypass password -keystore cacerts -storepass changeit -alias acegisecurity
  36. Owner: CN=localhost, OU=Acegi Security System for Spring, O=TEST CERTIFICATE ONL
  37. Y. DO NOT USE IN PRODUCTION., L=Unknown, ST=Unknown, C=Unknown
  38. Issuer: CN=localhost, OU=Acegi Security System for Spring, O=TEST CERTIFICATE ON
  39. LY. DO NOT USE IN PRODUCTION., L=Unknown, ST=Unknown, C=Unknown
  40. Serial number: 4080daf4
  41. Valid from: Sat Apr 17 07:21:24 GMT 2004 until: Tue Sep 02 07:21:24 GMT 2031
  42. Certificate fingerprints:
  43. MD5: B4:AC:A8:24:34:99:F1:A9:F8:1D:A5:6C:BF:0A:34:FA
  44. SHA1: F1:E6:B1:3A:01:39:2D:CF:06:FA:82:AB:86:0D:77:9D:06:93:D6:B0
  45. Trust this certificate? [no]: yes
  46. Certificate was added to keystore
  47. [Saving cacerts]
  48. 7. Finished. You can now run the sample application as if you purchased a
  49. properly signed certificate. For production applications, of course you should
  50. use an appropriately signed certificate so your web visitors will trust it
  51. (such as issued by Thawte, Verisign etc).
  52. TROUBLESHOOTING
  53. * A "sun.security.validator.ValidatorException: No trusted certificate
  54. found" indicates the cacerts is not being used or it did not correctly
  55. import the certificate. To rule out your web container replacing or in
  56. some way modifying the trust manager, set the
  57. CasAuthenticationProvider.trustStore property to the full file system
  58. location to your cacerts file.
  59. * If your web container is ignoring your cacerts file, double-check it
  60. is stored in $JAVA_HOME\lib\security\cacerts. $JAVA_HOME might be
  61. pointing to the SDK, not JRE. In that case, copy
  62. $JAVA_HOME\jre\lib\security\cacerts to $JAVA_HOME\lib\security\cacerts