什么是curl_easy_setopt的默认路径(curl,CURLOPT_CAINFO,“cacert.pem”);

问题描述:

此命令在哪里寻找pem文件?
它不在dll运行的文件夹中。
当我使用完整路径,当我使用相对路径 - 或者像Title或者./cacert.pem)
我得到错误77:CURLE_SSL_CACERT_BADFILE

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 ?

OK,看起来像使用相对路径工作BUT ....当你在调试器下运行它不是你的$(solutiondir)/ Debug文件夹!所以它应该在你的EXE的同一个文件夹上,当你运行它,但是当你调试,你需要把它也在另一个目录(我已经把它放在解决方案和项目dir,它工作)

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)