Your Spring-CAS configuration looks fine.
The only reason for an SSLHandshakeException to occur is because the SSL key was not imported correctly into the created key store or JVM key store.
When creating the key, you followed the following
Note: the alias name, which is CN (here it is cas), must be the same name as the host name of the machine.
to find the hostname of the machine, in the console or promt command, simply enter "hostname" without quotes.
Create a directory under the root named app
[root @localhost app] # keytool -genkey -alias cas -keyalg RSA -keystore.cas -storepass caspasswd
What is your first and last name? [Unknown]: cas What is the name of your organization unit? [Unknown]: MYCOMPANY What is your organization called? [Unknown]: MYCOMPANY. What is the name of your city or locality? [Unknown]: Bangalore What is your State or Province? [Unknown]: Karnataka What is the two-letter country code for this device? [Unknown]: IN Is CN = cas, OU = MYCOMPANY, O = MYCOMPANY, L = Bangalore, ST = Karnataka, C = IN is correct? [no Yes
Enter the password for the key (specify the password mentioned above - ie caspasswd in this case) (RETURN, if it is the same as the password of the keystore): enter the new password again:
[root @localhost app] # keytool -exportcert -alias cas -file cas.crt -keystore.cas Enter the keystore password: certificate stored in the file
[root @localhost app] # ls cas.crt softwares test.class test.java tomcat7027CAS
[root @localhost app] # keytool -import -alias cas -file cas.crt -keystore / app / softwares / jdk1.6.0_27 / ββjre / lib / security / cacerts Enter the keystore password: Owner: CN = cas, OU = MYCOMPANY, O = MYCOMPANY, L = Bangalore, ST = Karnataka, C = IN Issuer: CN = cas, OU = MYCOMPANY, O = MYCOMPANY, L = Bangalore, ST = Karnataka, C = IN Serial number: 510a6a63 Valid from: Thu Jan 31 18:28:11 IST 2013 until: Wed May 01 18:28:11 IST 2013 Fingerprint Certificate: MD5: 52: 8E: 2E: 74: C6: 57: CD: B3: B0: B6: 6C: 17 : D9: 0D: 77: F3 SHA1: 1F: AA: 4C: 22: B9: 16: DC: AA: D4: 87: 07: CF: DD: B2: 11: A6: AE: 36: 9A: DB Name signature algorithm: SHA1withRSA Version: 3 Trust this certificate? [no]: yes A certificate has been added to the keystore.
[root @localhost app] # keytool -list -keystore / app / softwares / jdk 1.6.0_27 / ββjre / lib / security / cacerts -alias cas Enter keystore password: cas, January 31, 2013, trustedCertEntry, Certificate fingerprint ( MD5): 52: 8E: 2E: 74: C6: 57: CD: B3: B0: B6: 6C: 17: D9: 0D: 77: F3
[root @localhost app] #
Inside your tomcat server.xml, you also use the https connector as shown below:
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" maxThreads="150" scheme="https" keystoreFile="/app/.cas" keystorePass="mykeypassword" secure="true" connectionTimeout="240000" clientAuth="false" sslProtocol="TLS" allowUnsafeLegacyRenegotiation="true" /> <Connector port="8069" protocol="AJP/1.3" redirectPort="8443" />
The above key was for CAS Server. You can create your own separate key for the application.
But both keys must be imported into the JVM cacerts key store (as indicated below)
Now the most important part: suppose the CAS Server alias name is cas
and your application server alias name is myapp
save both keys cas.crt and myapp.crt on both servers for import into the JVM
Do the following on both servers:
1) keytool -import -alias cas -file / app / cas.crt -keystore / usr / java / jdk 1.5.0_22 / jre / lib / security / cacerts
2) keytool -import -alias myapp -file / app / cas.crt -keystore / usr / java / jdk 1.5.0_22 / jre / lib / security / cacerts
To verify the use of the following commands -
1) keytool -list -v -keystore / usr / java / jdk 1.5.0_22 / jre / lib / security / cacerts -alias cas
2) keytool -list -v -keystore / usr / java / jdk 1.5.0_22 / jre / lib / security / cacerts -alias myapp
Make sure the Java - JRE - LIB - SECURITY - CACERTS file is used when using multiple versions of java
This will remove your error.
Note:
If after providing the correct user credential browser a blank white page is displayed, modify the system host file (/ etc / hosts on linux and c: \ windows \ system32 \ driver \ etc \ hosts on Windows)
add ip ip server there
eg.
162.25.250.60 myapp 162.25.250.81 cas
Any doubts can be clarified.
You can specify the following:
https://wiki.jasig.org/display/CASUM/SSL+Troubleshooting+and+Reference+Guide