当前位置 主页 > 服务器问题 > Linux/apache问题 >
# sign the certificate
echo "CA signing: $CSR -> $CERT:"
openssl ca -config ca.config -out $CERT -infiles $CSR
echo "CA verifying: $CERT <-> CA cert"
openssl verify -CAfile ./certs/ca.crt $CERT
# cleanup after SSLeay
rm -f ca.config
rm -f ca.db.serial.old
rm -f ca.db.index.old
# sign.sh END
echo "使用CA根证书签署服务器证书签署文件完毕。"
# 使用了 ssl 之后,每次启动 apache 都要求输入 server.key 的口令,
# 你可以通过下面的方法去掉口令输入(如果不希望去掉请注释以下几行代码):
echo "去除 apache 启动时必须手工输入密钥密码的限制:"
cp -f server.key server.key.org
openssl rsa -in server.key.org -out server.key
echo "去除完毕。"
# 修改 server.key 的权限,保证密钥安全
chmod 400 server.key
echo "Now u can configure apache ssl with following:"
echo -e "\tSSLCertificateFile ${sslOutputRoot}/server.crt"
echo -e "\tSSLCertificateKeyFile ${sslOutputRoot}/server.key"
# die gracefully
exit 0