douxunchen3498 2013-06-21 12:11
浏览 116

绕过SSL检查

I'm debugging an issue that someone is having in accessing a payment gateway using a PHP plugin. The only way he has been able to avoid a 404 error after clicking the Checkout button is by setting CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST to 0. I know this is bad, but does anyone know why this might be? It seems to be distrusting of the SSL certificate of the payment website...could this just be an issue with his server not trusting certain SSL certificates? The response he is getting from the curl_exec() function is just false when the checks are turned on.

EDIT: So I've seen multiple solutions that say to add something similar to this to my curlopt lines after getting the certificate file:

curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/CAcerts/certificate.cert");

But what if I'm dealing with a bunch of separate customers that are having this issue? That path won't work for everyone. What can I put instead that will apply to each person?

If I can't put a general line, then where would I tell the person to put their certificate file? This would have to be done by their web hosting service, right?

  • 写回答

2条回答 默认 最新

  • dongyao1895 2013-06-21 12:31
    关注

    here is a good answer to your problem: Security consequences of disabling CURLOPT_SSL_VERIFYHOST (libcurl/openssl)

    i suggest to analyze the certificate issued by the payment website..
    the url used by the php plugin is exactly the same specified in the common name field of the certificate?

    If you are sure the certificate provided it's ok, and trusted, You could set the CURLOPT_CAINFO option to trust this certificate and avoid the error: curl_setopt($ch, CURLOPT_CAINFO, 'C:\path\to\curl-ca-bundle.crt');

    评论

报告相同问题?

悬赏问题

  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法