dtdfj08626 2018-08-31 14:42 采纳率: 0%
浏览 81
已采纳

PHP卷曲 - 发送证书的正确方法?

Im using a webservice that requires autentication it one cliente certificate sended by curl. I already have the certificate (.pem), the public key and the private key (.pem) extracted from a .pfx file.

Im sending then like this:

    curl_setopt($ch, CURLOPT_SSLCERT, '_cert.pem');
    curl_setopt($ch, CURLOPT_SSLKEY, '_priKEY.pem');
    curl_setopt($ch, CURLOPT_SSLCERTTYPE, 'PEM');
    curl_setopt($ch, CURLOPT_KEYPASSWD, '****');

But the WS always return the message that i need to send the cliente certificate. Whats is the correct way to send?

Other questions: Did i not need to send the public key file? and "keypasswd" is realy necessary?

  • 写回答

1条回答 默认 最新

  • dongyun6835 2018-10-02 15:17
    关注

    I was using "HTTP", and to send the certificate on the request, i need to use "HTTPS".

    Don't need to use "CURLOPT_SSLCERTTYPE" option when the format is .pem, because the .pem is already the default format. The "public key", usualy, do not need to be sent, only the private key (when the certificate has one).

    The "CURLOPT_KEYPASSWD" need to be used when the private key have some passphrase, other wise, don't use it.

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

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么