2005年11月17日 星期四

apache SSL by openssl

1.Create a RSA private key for your server (will be Triple-DES encrypted and PEM formatted):

openssl genrsa -des3 -out server.key 1024

2.Create a self-signed Certificate (X509 structure) with the RSA key you just created (output will be PEM formatted):

openssl req -new -x509 -nodes -sha1 -days 365 -key server.key -out server.crt

懶人法:
openssl req -new -x509 -nodes -out server.crt -keyout server.key
These can be used as follows in your httpd.conf file: (不一定在httpd.conf)
SSLCertificateFile /path/to/this/server.crt
SSLCertificateKeyFile /path/to/this/server.key

沒有留言: