简体   繁体   English

libcurl-NSS使用tls构建了Imap:SSL CA证书(路径?访问权限?)窗口

[英]libcurl-NSS built Imap with tls :SSL CA cert (path? access rights?) windows

I am currently trying to make an imap client with libcurl on a windows application. 我目前正在尝试在Windows应用程序上使用libcurl创建一个imap客户端。 I am using a prebuilt version of libCurl built with NSS support but no OpenSSL support ( that was decided by an higher up), and when I try to connect to my server with the URL imaps://serveraddress/inbox, with CURLOPT_USE_SSL set to CURLUSESSL_ALL, and CURLOPT_CAINFO to my certificate nickname in cert8.db I get 我正在使用libsurl的预构建版本,该版本具有NSS支持,但没有OpenSSL支持(由上级决定),当我尝试使用URL imaps:// serveraddress / inbox连接到我的服务器时,将CURLOPT_USE_SSL设置为CURLUSESSL_ALL和CURLOPT_CAINFO到我在cert8.db中的证书昵称

* Trying servAdress...
* TCP_NODELAY set
Connected to servAdress (servAdress) port portn(#0)
WARNING: failed to load NSS PEM library libnsspem.so. Using OpenSSL PEM certificates will not work.
CAfile: certname
CApath: none
    *Closing connection 0
curl_easy_perform() failed: Problem with the SSL CA cert (path? access rights?)

I tried setting CURLOPT_SSLCERT to my certName instead I get the same error except that line is added : 我尝试将CURLOPT_SSLCERT设置为我的certName,但是除了添加以下行之外,我得到了相同的错误:

* Initializing NSS with certpath: sql:C:\Users\mlegros\SSL_DB\

my question is is there a way to use NSS db Certificate with imap in libcurl? 我的问题是有没有办法在libcurl中的imap中使用NSS db证书?

also is it normal that a windows dll try to load a .so file (it is a linux format if I am not mistaken)? Windows dll尝试加载.so文件也是正常的吗(如果我没记错的话,它是linux格式)?

ps: here are my version info ps:这是我的版本信息

  • curl version 7.58.0 卷曲版本7.58.0

  • NSS 3.34.1 NSS 3.34.1

  • compilator: MSVC 14.12.25827 编译器:MSVC 14.12.25827

Hope you can help me. 希望您能够帮助我。

So the problem was within libcurl 所以问题出在libcurl

the libraries name are hard-coded with the linux name and if libnssckbi is not loaded we cannot load another certificate the second part as been modified according to this https://github.com/curl/curl/pull/3016 . 库名称使用Linux名称进行硬编码,如果未加载libnssckbi,则无法加载另一证书,第二部分已根据此https://github.com/curl/curl/pull/3016进行了修改。

a quickfix if you don't want to recompile libcurl is to rename nssckbi.dll to libnssckbi.so 如果您不想重新编译libcurl,则一个快速解决方案是将nssckbi.dll重命名为libnssckbi.so。

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

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