what is the default path for curl_easy_setopt(curl, CURLOPT_CAINFO, “cacert.pem”);

匆匆过客 提交于 2019-12-11 17:58:48

问题


Where does this command look for the pem file ? It is not in the folder where the dll runs. When I use full path it works, when I use relative path - either like in the Title or ./cacert.pem) I get Error 77: CURLE_SSL_CACERT_BADFILE

What is the right way to specify relative path for this file ?


回答1:


Specifying a relative path there is asking for trouble. But it'd then use the relative path from whereever it is executed (no surprise there really).

Possibly the SSL library your libcurl is built to use doesn't even like a relative path.




回答2:


OK, It looks like using a relative path works BUT.... When you run it under debugger it is not your $(solutiondir)/Debug folder ! so it should be on the same folder of your EXE when you run it, but when you debug, you need to put it also on another directory (I've put it on solution and project dir and it worked)



来源:https://stackoverflow.com/questions/18865682/what-is-the-default-path-for-curl-easy-setoptcurl-curlopt-cainfo-cacert-pem

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!