2010-10-29

lighttpd配置HTTPS(SSL)

Views: 11177 | Add Comments

1. 创建SSL证书

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

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

2. lighttpd配置

$SERVER["socket"] == ":443" {
    $HTTP["host"] == "ideawu.net" {
        ssl.engine = "enable" 
        ssl.pemfile = "/home/work/lighttpd-1.5/conf/ideawu.net.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

Related posts:

  1. Nginx 安装 HTTPS SSL 证书
  2. HTTP POST using PHP cURL
  3. Tomcat网站server.xml设置
  4. SSDB常规升级-更新到leveldb-1.14.0, Windows安装包
  5. Nginx + PHP 配置和启动脚本
Posted by ideawu at 2010-10-29 10:45:18

Leave a Comment