doumeng3080 2016-11-30 23:22
浏览 1269
已采纳

如何在php.ini中向curl.cainfo添加多个ssl证书?

I'm running Apache locally for developing multiple sites and would like to run them simultaneously. The sites talk to each other over ssl, and since it is a local setup, I'm using self-signed certificates.

To get php(5.5.26) to accept these certificates, I added them to the curl.cainfo property in php.ini. I got it to work with one certificate, but when I try adding multiple (3), it doesn't work (I don't get anything back when making a request from one site to the other in php). I tried the following formats:

Separate Lines:

curl.cainfo=/path/to/certificate.crt
curl.cainfo=/path/to/another/certificate.crt
curl.cainfo=/path/to/last/certificate.crt

Same line, comma separated curl.cainfo=/path/to/certificate.crt,/path/to/another/certificate.crt,/path/to/last/certificate.crt

Same line, colon separated curl.cainfo=/path/to/certificate.crt:/path/to/another/certificate.crt:/path/to/last/certificate.crt

Any other ideas?

  • 写回答

1条回答 默认 最新

  • douliaopan1419 2016-12-01 07:51
    关注

    The underlying CURLOPT_CAINFO option in libcurl only supports a single file name, and PHP/CURL merely passes on that string to libcurl. So no, you cannot pass more than one file name. You can however concatenate all those files into a single one, and point to that.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵