马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
本文基于Liferay 4.3,采用默认的cas验证。在生产环境中,请参阅cas手册,调整cas验证方法。下文的keytool都是在命令行下运行,keytool使用方法请参见sun手册。
Liferay 4.3的cas配置同4.2类似,我们一步步来。
首先检查是否已有创建过同名证书 - keytool -list -v -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
keytool -list -v -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
如果找到同名证书,请找到原有创建时的证书keystore,如果找不到可以使用
Java代码 [url=http://www.javaeye.com/topic/122831] - keytool -delete -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
keytool -delete -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
删除已有的证书。
原始证书删除后,将会影响到使用该证书的应用,请谨慎决定
随后创建所需证书
- keytool -genkey -alias tomcat -keystore c:\mykeystore -dname "CN=localhost, OU=localhost, O=localhost, L=SH, ST=SH, C=CN" -keypass changeit -storepass changeit
-
- keytool -export -alias tomcat -keystore c:\mykeystore -file c:\mycerts.cer -storepass changeit
-
- keytool -import -trustcacerts -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit -file c:\mycerts.cer
keytool -genkey -alias tomcat -keystore c:\mykeystore
-dname "CN=localhost, OU=localhost, O=localhost, L=SH, ST=SH, C=CN" -keypass changeit -storepass changeit keytool -export -alias tomcat -keystore c:\mykeystore -file c:\mycerts.cer -storepass changeit keytool -import -trustcacerts -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit -file c:\mycerts.cer
证书创建完成后,依旧是用-list检测
Java代码 [url=http://www.javaeye.com/topic/122831] - keytool -list -v -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit
keytool -list -v -alias tomcat -keystore "%JAVA_HOME%/JRE/LIB/SECURITY/CACERTS" -storepass changeit - <Connector port="8443" maxHttpHeaderSize="8192"
- maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
- enableLookups="false" disableUploadTimeout="true"
- acceptCount="100" scheme="https" secure="true"
- clientAuth="false" sslProtocol="TLS"
- URIEncoding="UTF-8" keystoreFile="c:\mykeystore" keystorePass="changeit" keyAlias="tomcat"/>
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
URIEncoding="UTF-8" keystoreFile="c:\mykeystore" keystorePass="changeit" keyAlias="tomcat"/>
修改liferay配置文件
在liferay 的webapps\ROOT\WEB-INF\classes下,修改(创建)portal-ext.properties,在其中添加
Java代码 [url=http://www.javaeye.com/topic/122831] cas.auth.enabled=true
启动liferay,在首页上选择右上角 Sign In,页面跳转到cas登陆页面
使用 joebloggs/joebloggs登陆liferay.
|