產生key:
1.. openssl genrsa -out ca.key 2048
- openssl req -new -key ca.key -out ca.csr
-----------key content-------------------------------------------------------
Country Name (2 letter code) [XX]:TW
State or Province Name (full name) []:TW
Locality Name (eg, city) [Default City]:TW
Organization Name (eg, company) [Default Company Ltd]:DNI
Organizational Unit Name (eg, section) []:DNI
Common Name (eg, your name or your server's hostname) []:DNI
Email Address []:[email protected]
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:12345678
An optional company name []:TW
openssl x509 -req -days 36500 -in ca.csr -signkey ca.key -out ca.crt
cp ca.crt /etc/pki/tls/certs
cp ca.key /etc/pki/tls/private/ca.key
cp ca.csr /etc/pki/tls/private/ca.csr
修改SSL:
gedit /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
啟動方法:
- service httpd restart
本機測試:
選擇性的修改:
- gedit etc/httpd/httpd.conf
add below to the bottom
NameVirtualHost *.443
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
<Directory /var/www/html/>
AllowOverride All
</Directory>
DocumentRoot /var/www/html/
ServerName test.com
</VirtualHost>