PHP如何配置默认SSL CA证书

PHPz
Release: 2020-09-04 14:52:58
Original
3975 people have browsed it

PHP如何配置默认SSL CA证书

PHP配置默认SSL CA证书的方法:

1、从CURL 官网下载CA 证书(当然也可以选择自己创建SSL CA证书,详情参考 https://blog.csdn.net/scuyxi/article/details/54898870 ,或自行百度)

CA 证书下载地址:https://curl.haxx.se/docs/caextract.html 页面去选择下载

或:https://curl.haxx.se/ca/cacert.pem

 

2、在PHP安装目录下新建一个文件夹cacert 来存放CA证书

修改php.ini配置

启用openssl, curl扩展

搜索 extension ,去掉需要开启扩展前的分号注释

extension=curl
extension=openssl
Copy after login

搜索 [curl] 和 [openssl] ,找到curl 和oppenssl 配置模块

;配置CA 证书存放位置
curl.cainfo= H:/phpapache/php-7.2.7-ts-x64/cacert/cacert.pem
openssl.cafile=H:/phpapache/php-7.2.7-ts-x64/cacert/cacert.pem
;配置CA 证书目录
openssl.capath=H:/phpapache/php-7.2.7-ts-x64/cacert
Copy after login

3、Apache 配置 SSL 证书

先申请SSL证书

开启 OpenSSL module 模块

LoadModule ssl_module modules/mod_ssl.so 去掉全面的 # 号
Copy after login

 

 

若是电子商务网站或安全性要求高的网站不推荐DV SSL(Domain Validation SSL 是只验证域名所有权的SSL证书)

更多相关知识,请访问PHP中文网

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template