简体   繁体   English

libcurl窗口alertnative不支持Htt,而不是使用CURLOPT_CAINFO

[英]Https is not supported in libcurl window alertnative than using CURLOPT_CAINFO

We are using libcurl (7.3.6) in our application. 我们在我们的应用程序中使用libcurl(7.3.6)。 API call for "Https URL" giving "curle_ssl_cacert error". API调用“Https URL”给出“curle_ssl_cacert错误”。 I have been able to resolve this using 我已经能够解决这个问题

    curl_easy_setopt(curl, CURLOPT_CAINFO, "PATH\\curl-ca-bundle.crt"); 

but we don't want to maintain this file in our application. 但我们不想在我们的应用程序中维护此文件。 Is there any way we can directly access from OS or from an alternative location? 我们有什么方法可以直接从操作系统或其他位置访问?

For Windows, 对于Windows,

If you want to use windows own "CA certificate", You need to rebuild curl to with schannel backend instead(aka "winssl"). 如果您想使用Windows自己的“CA证书”,您需要使用schannel后端(又名“winssl”)重建curl。 It will access from windows cert store by default. 默认情况下,它将从Windows证书库访问。 Openssl does not support to use windows system certificate on its own(see this answer ), and must specify the certificate in PEM format, or set the default certificate when building libcurl with parameter --with-ca-bundle and --with-ca-path . Openssl不支持单独使用Windows系统证书(请参阅此答案 ),并且必须以PEM格式指定证书,或者在使用参数--with-ca-bundle--with-ca-path构建libcurl时设置默认证书--with-ca-path

For Linux, 对于Linux,

According to the document : 根据该文件

If libcurl was built with NSS support, then depending on the OS distribution, it is probably required to take some additional steps to use the system-wide CA cert db. 如果libcurl是使用NSS支持构建的,那么根据操作系统分发,可能需要采取一些额外步骤来使用系统范围的CA cert db。 RedHat ships with an additional module, libnsspem.so, which enables NSS to read the OpenSSL PEM CA bundle. RedHat附带了一个额外的模块libnsspem.so,它使NSS能够读取OpenSSL PEM CA包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM