在Debian系统上配置OpenSSL的证书链,通常涉及以下几个步骤:
获取证书:
合并证书:
cat server.crt intermediate.crt root.crt > fullchain.crt
配置OpenSSL:
/etc/ssl/openssl.cnf或/etc/ssl/openssl/openssl.cnf。[ req ]
default_bits = 2048
prompt = no
default_md = sha256
req_extensions = req_ext
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
stateOrProvinceName = State or Province Name
localityName = Locality Name
0.organizationName = Organization Name
organizationalUnitName = Organizational Unit Name
commonName = Common Name
[ req_ext ]
subjectAltName = @alt_names
[ alt_names ]
DNS.1 = yourdomain.com
配置Web服务器:
/etc/apache2/sites-available/your-site.conf文件,添加或修改以下内容:<VirtualHost *:443>
ServerName yourdomain.com
SSLEngine on
SSLCertificateFile /path/to/fullchain.crt
SSLCertificateKeyFile /path/to/private.key
# 其他配置...
</VirtualHost>
/etc/nginx/sites-available/your-site文件,添加或修改以下内容:server {
listen 443 ssl;
server_name yourdomain.com;
ssl_certificate /path/to/fullchain.crt;
ssl_certificate_key /path/to/private.key;
# 其他配置...
}
重启Web服务器:
sudo systemctl restart apache2
sudo systemctl restart nginx
验证配置:
openssl命令来验证证书链:openssl s_client -connect yourdomain.com:443 -showcerts
通过以上步骤,你应该能够在Debian系统上成功配置OpenSSL的证书链。