作业帮 > 建站经验 > 教育资讯

建站教程:ghttpd配置HTTPS(SSL)

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/12 11:28:38 建站经验
建站教程:ghttpd配置HTTPS(SSL)
建站教程:ghttpd配置HTTPS(SSL)建站经验
【无忧考网-建站教程:ghttpd配置HTTPS(SSL)】:

1. 创建SSL证书

openssl req -new -x509 \
-keyout ideawu.pem -out ideawu.pem \
-days 99365 -nodes

把 ideawu.pem 拷贝到 /home/work/lighttpd-1.5/conf/

2. lighttpd配置

$SERVER["socket"] == ":443" {
    $HTTP["host"] == "ideawu" {
        ssl.engine = "enable"
        ssl.pemfile = "/home/work/lighttpd-1.5/conf/ideawu.pem"
    }
}

3. 访问:

https://localhost:443

4. API和工具使用:

wget –no-check-certificate https://localhost:443

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

补充: Apache HTTPS
openssl genrsa 1024 > server.key
openssl req -new -key server.key > server.csr
openssl req -x509 -days 99365 -key server.key -in server.csr > server.crt

建站经验