futurezone 2016-12-27
对于resin官方版本对接openssl有个坑;把我差点坑死了;
注意:resin版本对于openssl只有pro版本支持;我下载了两个非pro版本都不可用;
实现步骤:
1.安装openssl:
cd /usr/local yum install openssl openssl-devel -y
2.生成ssl的crt,key文件
openssl genrsa -des3 -out test.key 1024 openssl req -new -key test.key -x509 -out test.crt openssl req -new -key test.key -out test.csr
注意:可以参考http://www.linuxidc.com/Linux/2013-08/88271.htm博客
也可以参考http://www.willrey.com/support/ssl_resin.html
2.解压你的resin包(官网:http://caucho.com/products/resin/download/archive)
cd /usr/local tar -zxvf resin-pro-4.0.49.tar.gz
3.执行配置文件configure(执行目录/usr/local/resin-pro-4.0.49)
./configure --prefix=/usr/local/resin-pro-4.0.49 --enable-64bit --enable-ssl --with-openssl=/usr/
注意:官方的执行缺少了prefix=/usr/local/resin-pro-4.0.49目录会执行失败;
如果指定java-home:可以追加--with-java-home=/usr/local/resin-4.0.44/jdk1.7.0_79/
4.然后执行make命令;
cd /usr/local/resin-pro-4.0.49 make make install
5.修改配置文件:
a.修改resin.xml文件
<http port="443"> <openssl> <certificate-key-file>keys/your_domain.key</certificate-key-file> <certificate-file>keys/your_domain.crt</certificate-file> <certificate-chain-file>keys/chain.txt</certificate-chain-file> <password>test123</password> <protocol>-sslv3</protocol> </openssl> </http>
b.或者修改resin.perportis(前提:resin.xml文件不修改)
# OpenSSL certificate configuration # Keys are typically stored in the resin configuration directory. # openssl_file : keys/test.crt # openssl_key : keys/test.key # openssl_password : changeme # openssl_protocols : -sslv2 -sslv3