How would you run a get request via curl on an ssl

2019-07-30 00:29发布

$url = 'https://thewebsite.com/';
    $this->curl->create($url);
    $this->curl->ssl(TRUE);

    echo $this->curl->simple_get($url);

That's the code i'm running via codeigniter and the curl codeigniter library.

Is there any way around this?

I get nothing when i run the request.

1条回答
萌系小妹纸
2楼-- · 2019-07-30 00:30

TRUE, in this case, means that you are checking their site against an SSL certificate. If you have the certificate, then you need to pass in the third parameter of curl->ssl (the path to the certificate). If you don't want to check against their certificate, then you can simply pass FALSE as the parameter to the ssl method.

More on cURL and SSL here (not CodeIgniter, just regular ol' PHP + cURL).

查看更多
登录 后发表回答