NOTE: Special Things About CAS
1
Create the Certificate
打开终端,进到 home 目录,运行命令:
1
| |
需要输入:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
如何给这些值?
For the keystore password you should enter “changeit” without the quotation marks. When prompted for the first and last name, you should enter your machine name during development. The rest of the data does not matter. Then obviously answer “yes” to the question of whether it’s correct.
注意: CAS 协议需要走 HTTPS,为了保证能够工作, “first and last name” 为 $FULL_MACHINE_NAME。Mac 上获取计算机全名的方法是:
scutil --get ComputerName或者scutil --get LocalHostName。
下一步,打开 $TOMCAT_HOME/conf/server.xml,找到这一块,去掉注释即可:
1 2 3 4 5 | |
重启 Tomcat,访问
1
| |
Any application that wishes to securely connect to this Tomcat instance would need to import the certificate. You can export the certificate that’s compatible with other JVM keystores by executing the following command:
所有想访问该 Tomcat 实例的应用都需要导入证书。首先导出证书,需要输入 keystore 的密码,这里就是 changeit:
1
| |
输出是:
1 2 | |
You can then import the server.crt into other JVM keystore’s by executing a command similar to this:
1
| |
It’s recommended that you add it to the JVM keystore of your local development machine to facilitate testing.
2
Maven War Overlay1