什么是curl_easy_setopt的默认路径(curl,CURLOPT_CAINFO,“cacert.pem”); [英] what is the default path for curl_easy_setopt(curl, CURLOPT_CAINFO, "cacert.pem");

查看:2286
本文介绍了什么是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)

这篇关于什么是curl_easy_setopt的默认路径(curl,CURLOPT_CAINFO,“cacert.pem”);的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆