SSL_CTX_load_verify_locations Fails with SSL_ERROR_NONE

SSL_CTX_load_verify_locations Fails with SSL_ERROR_NONE

本文关键字:SSL with NONE Fails ERROR verify CTX load locations      更新时间:2023-10-16

我已经搜索了高低,没有找到这个问题的解释。

我正在运行以下内容

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_ERROR_NONE

SSL_ERROR_NONE意味着函数实际上成功了。

我可以相信SSL_CTX_load_verify_locations函数确实成功运行了吗?

man SSL_CTX_load_verify_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.