c++ - server certificate verification failed. CAfile: ca.pem CRLfile: none -
i want make https tests using libcurl , openssl in c++. have following code:
curl_easy_setopt(measyhandle, curlopt_ssl_verifypeer, 1l); curl_easy_setopt(measyhandle, curlopt_ssl_verifyhost, 2l); result = curl_easy_setopt(measyhandle, curlopt_cainfo , "ca.pem"); i have windows server listens on 192.168.0.101:4443. when running program visual studio, certificate verification works, on linux error server certificate verification failed. cafile: ca.pem crlfile: none.
in ca.pem have put content generated in server's certificate (testing on windows works, on linux not).
* trying 192.168.0.101... * connected 192.168.0.101 (192.168.0.101) port 4443 (#0) * found 1 certificates in ca.pem * server certificate verification failed. cafile: ca.pem crlfile: none * closing connection 0 update:
i have folder /etc/ssl/certs contains lot of ca certs files. have copied ca.pem /etc/ssl/certs , run update-ca-certificates produced output:
updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. running hooks in /etc/ca-certificates/update.d....done.
i have solved this. certificate problem in fact. code worked timestamp on machine before certificate generated.
Comments
Post a Comment