Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/129.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ SSL\u CTX\u加载\u验证\u位置失败,SSL\u错误\u无_C++_Openssl - Fatal编程技术网

C++ SSL\u CTX\u加载\u验证\u位置失败,SSL\u错误\u无

C++ SSL\u CTX\u加载\u验证\u位置失败,SSL\u错误\u无,c++,openssl,C++,Openssl,我到处找,没有找到这个问题的解释 我正在运行以下程序 int ret = 0; ERR_clear_error(); ret = SSL_CTX_load_verify_locations( ctx_, "f:\\50\\server\\SSLCACertificateFile.pem", NULL ); 我得到的ret值为1,这是一个错误。然后检查错误队列 int err = SSL_get_error( con_, ret ); 返回的错误值为零。该值与错误关联:SSL\u error\

我到处找,没有找到这个问题的解释

我正在运行以下程序

int ret = 0;
ERR_clear_error();
ret = SSL_CTX_load_verify_locations( ctx_, "f:\\50\\server\\SSLCACertificateFile.pem", NULL );
我得到的ret值为1,这是一个错误。然后检查错误队列

int err = SSL_get_error( con_, ret );
返回的错误值为零。该值与错误关联:
SSL\u error\u NONE

SSL\u ERROR\u NONE
表示函数实际成功


我能相信
SSL\u CTX\u load\u verify\u locations
功能确实成功运行吗?

man SSL\u CTX\u load\u verify\u locations

RETURN VALUES

   The following return values can occur:

   0   The operation failed because CAfile and CApath are NULL or the processing at one of the locations specified failed. Check the error stack to find out the
       reason.

   1   The operation succeeded.

感谢Vladimir,当我在这里转到Openssl.org时:我看到了返回值的以下信息:可能会出现以下返回值:1操作失败,因为CAfile和CApath为NULL,或者指定位置之一的处理失败。检查错误堆栈以找出原因。2手术成功。我想知道哪个是正确的man或openssl本身?您可以查找源文件,并在ssl/ssl_lib.c中找到定义,它从crypto/X509/X509_d2.c调用X509_STORE_load_位置,成功后返回1:您还可以查找前面提到的网页版本的源代码,并且没有定义1和2个返回值:没有HTML从1开始编号而不是从零开始编号的列表。哇。非常感谢,弗拉基米尔。上次我盲目信任文档。你教了我一种新的调试方法。我在过去做过这件事,但在这种情况下我从来没有意识到,因为我有文档。吸取的教训。再次感谢。这是一个非常罕见的例外。你不必偏执。”正如谚语所说,信任但要验证。