fishcorecpe和openacs使用https进行交互的技术设置和服务部署
2014-02-10 10:34
991 查看
本文提及的技术中,openacs使用keytool+tomcat配置HTTPS双向证书认证,fishcorecpe需要openacs签署的证书进行验证交互。
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
部署步骤:
在/opt/jboss-4.2.3.GA/server/default/conf目录下执行以下指令:
为服务器生成证书:
keytool -genkey -alias tomcat -keyalg RSA -keystore tomcat.keystore -validity 36500
为服务器生成PKCS12证书:
keytool -genkey -v -alias clients -keyalg RSA -storetype PKCS12 -keystore clients.p12 -validity 36500
由于是双向SSL认证,服务器必须要信任客户端证书,因此,必须把客户端证书添加为服务器的信任认证。由于不能直接将PKCS12格式的证书库导入,必须先把客户端证书导出为一个单独的CER文件:
keytool -export -alias clients -keystore clients.p12 -storetype PKCS12 -storepass fishcorecpe -rfc -file clients.cer
将客户端证书导入到服务器的证书库,添加为一个信任证书:
keytool -import -v -file clients.cer -keystore tomcat.keystore
通过list命令查看服务器的证书库,可以看到两个证书,一个是服务器证书,一个是受信任的客户端证书:
keytool -list -keystore tomcat.keystore
为便于客户端使用,将PKCS12格式证书中的私钥提取并转存为PEM格式:
openssl pkcs12 -nocerts -nodes -in clients.p12 -out clients.pem 用这个
验证 openssl pkcs12 -clcerts -nokeys -in clients.p12 -out clientsv.pem将证书和私钥合并存储在一个证书链文件中:
cat clients.cer clients.pem >fishcore.pem
将fishcore.pem复制到fishcorecpe固件相同目录下。
修改fishcore.conf中acsurl为https格式。
修改/opt/jboss-4.2.3.GA/server/default/deploy/jboss-web.deployer下server.xml文件中Connector port="8443"相关内容为以下:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" address="${jboss.bind.address}"
maxThreads="150" scheme="https" secure="true"
clientAuth="true" keystoreFile="${jboss.server.home.dir}/conf/tomcat.keystore" keystorePass="fishcorecpe"
truststoreFile="${jboss.server.home.dir}/conf/tomcat.keystore" truststorePass="fishcorecpe" sslProtocol="TLS" />
保存,重启openacs后,可以直接运行fishcorecpe,将以https进行交互.
参考: http://blog.sina.com.cn/s/blog_5f64eccd0100p0pc.html
http://blog.sina.com.cn/s/blog_4c95c67e0100xy3m.html
http://www.diybl.com/course/4_webprogram/jsp/jsp_js/200855/113649.html
本文和fishcorecpe中所有涉及的密钥均为 fishcorecpe
使用其他方式生成证书的情况,请google后并生成所有必需的证书后,根据fishcorecpe软件的readme中的配置参数说明进行配置验证。
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
部署步骤:
在/opt/jboss-4.2.3.GA/server/default/conf目录下执行以下指令:
为服务器生成证书:
keytool -genkey -alias tomcat -keyalg RSA -keystore tomcat.keystore -validity 36500
为服务器生成PKCS12证书:
keytool -genkey -v -alias clients -keyalg RSA -storetype PKCS12 -keystore clients.p12 -validity 36500
由于是双向SSL认证,服务器必须要信任客户端证书,因此,必须把客户端证书添加为服务器的信任认证。由于不能直接将PKCS12格式的证书库导入,必须先把客户端证书导出为一个单独的CER文件:
keytool -export -alias clients -keystore clients.p12 -storetype PKCS12 -storepass fishcorecpe -rfc -file clients.cer
将客户端证书导入到服务器的证书库,添加为一个信任证书:
keytool -import -v -file clients.cer -keystore tomcat.keystore
通过list命令查看服务器的证书库,可以看到两个证书,一个是服务器证书,一个是受信任的客户端证书:
keytool -list -keystore tomcat.keystore
为便于客户端使用,将PKCS12格式证书中的私钥提取并转存为PEM格式:
openssl pkcs12 -nocerts -nodes -in clients.p12 -out clients.pem 用这个
验证 openssl pkcs12 -clcerts -nokeys -in clients.p12 -out clientsv.pem将证书和私钥合并存储在一个证书链文件中:
cat clients.cer clients.pem >fishcore.pem
将fishcore.pem复制到fishcorecpe固件相同目录下。
修改fishcore.conf中acsurl为https格式。
修改/opt/jboss-4.2.3.GA/server/default/deploy/jboss-web.deployer下server.xml文件中Connector port="8443"相关内容为以下:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" address="${jboss.bind.address}"
maxThreads="150" scheme="https" secure="true"
clientAuth="true" keystoreFile="${jboss.server.home.dir}/conf/tomcat.keystore" keystorePass="fishcorecpe"
truststoreFile="${jboss.server.home.dir}/conf/tomcat.keystore" truststorePass="fishcorecpe" sslProtocol="TLS" />
保存,重启openacs后,可以直接运行fishcorecpe,将以https进行交互.
参考: http://blog.sina.com.cn/s/blog_5f64eccd0100p0pc.html
http://blog.sina.com.cn/s/blog_4c95c67e0100xy3m.html
http://www.diybl.com/course/4_webprogram/jsp/jsp_js/200855/113649.html
本文和fishcorecpe中所有涉及的密钥均为 fishcorecpe
使用其他方式生成证书的情况,请google后并生成所有必需的证书后,根据fishcorecpe软件的readme中的配置参数说明进行配置验证。
相关文章推荐
- 使用TFS进行每日构建,MSBuild自动部署参数设置
- 使用AngularJS的$http服务与服务端进行数据交互
- 技术专题:在不改变网络设置的情况下,使用WAYOS的QOS功能对客户机进行流量管理
- android 使用https与服务器进行通信交互
- 访问https接口,进行数据交互(已在实际项目中使用)
- 使用APMServ服务配置如何进行Wordpress本地伪静态设置
- 使用花生壳、路由器、个人电脑进行站点部署并实现外网域名访问图文详解(花生壳设置方法 使用方法 使用教程)(转)
- (android 互联网开发)2 访问https接口,进行数据交互(已在实际项目中使用)
- 使用WifiManager服务进行wifi相关设置实现
- 使用Rancher在Kubernetes上进行微服务部署
- dubbo服务部署到Tomcat以及https访问设置
- ruby进行rpc服务的建立,并且设置端口号(XMLRPC 及 ruby的xmlrpc如何使用)
- 使用花生壳、路由器、个人电脑进行站点部署并实现外网域名访问图文详解(花生壳设置方法 使用方法 使用教程)
- 使用component将Restlet服务当做单独的Java程序进行部署
- 使用花生壳、路由器、个人电脑进行站点部署并实现外网域名访问图文详解(花生壳设置方法 使用方法 使用教程)
- iOS开发工具-如何使用网络封包分析工具Charles,通过配置proxy对http、https、tcp、udp 等协议的请求响应过程交互信息进行分析、判断、解决我们移动开发中的遇到的各种实际问题。
- 设置Windows服务允许进行桌面交互,实现屏幕监控
- 在AIX Version 5.3中使用Java和PHP技术进行开发,第1部分:设置Java环境
- iOS与H5交互 H5与App原生交互,一般会是前端页面中的JavaScript与App使用的原生开发语言的交互。技术方案应能达到以下要求: 在js与原生进行交互的时候能保证正常的正向调用逻辑返回
- 使用花生壳、路由器、个人电脑进行站点部署并实现外网域名访问图文详解(花生壳设置方法 使用方法 使用教程)