分类:
2007-01-11 19:51:09
代码: |
#rpm –e –-nodeps openssl |
代码: |
#tar xzvf openssl-0.9.7e.tar.gz |
代码: |
#cd openssl-0.9.7e #./config --prefix=/usr/local/openssl #make #make test #make install |
代码: |
#tar zxvf httpd-2.0.52.tar.gz #cd httpd-2.0.52 #./configure --prefix=PREFIX --enable-ssl --enable-rewrite --enable-so --with-ssl=/usr/local/openssl #make #make install |
代码: |
[root@win ssl]# cp /usr/local/openssl/ssl/misc/CA.sh /usr/local/apache/conf/ssl.crt/CA.sh |
代码: |
[root@win ssl.crt]# ./CA.sh -newca |
引用: |
Country Name (2 letter code) [GB]:CN State or Province Name (full name) [Berkshire]:FUJIAN Locality Name (eg, city) [Newbury]:FUZHOU Organization Name (eg, company) [My Company Ltd]:FJJM Organizational Unit Name (eg, section) []:FD Common Name (eg, your name or your server's hostname) []:WIN Email Address []:WIN@WIN.COM |
代码: |
[root@win ssl.crt]# openssl genrsa -des3 -out server.key 1024 |
代码: |
[root@win ssl.crt]# openssl req -new -key server.key -out server.csr |
代码: |
Country Name (2 letter code) [GB]:CN State or Province Name (full name) [Berkshire]:FUJIAN Locality Name (eg, city) [Newbury]:FUZHOU Organization Name (eg, company) [My Company Ltd]:FJJM Organizational Unit Name (eg, section) []:FD Common Name (eg, your name or your server's hostname) []:WIN Email Address []:WIN@WIN.COM Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:WIN An optional company name []:WING |
代码: |
[root@win ssl.crt]# mv server.csr newreq.pem [root@win ssl.crt]# ./CA.sh -sign |
代码: |
[root@win ssl.crt]# mv newcert.pem server.crt |
代码: |
[root@win ssl.crt]# openssl genrsa -des3 -out client.key 1024 |
代码: |
[root@win ssl.crt]# openssl req -new -key client.key -out client.csr |
代码: |
[root@win ssl.crt]# openssl ca -in client.csr -out client.crt |
代码: |
[root@win ssl.crt]# openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.pfx |
代码: |
#cp demoCA/cacert.pem cacert.pem |
代码: |
#cp cacert.pem ca.crt |
代码: |
#cd /usr/local/apache/conf |
代码: |
指定服务器证书位置 SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt 指定服务器证书key位置 SSLCertificateKeyFile /usr/local/apache/conf/ssl.crt/server.key 证书目录 SSLCACertificatePath /usr/local/apache/conf/ssl.crt 根证书位置 SSLCACertificateFile /usr/local/apache/conf/ssl.crt/cacert.pem 开启客户端SSL请求 SSLVerifyClient require SSLVerifyDepth 1 |
代码: |
/usr/local/apache/bin/apachectl startssl |