when i run this code i got error info:
- About connecting () to the port 10.12.190.155 443 (# 0)
- Attempt 10.12.190.155 ... * connected
- Connected to 10.12.190.155 (12.12.190.155) port 443 (# 0)
- Initializing NSS with certpath: sql: / etc / pki / nssdb
- CA File: /home/wh/work/sslkey/ca.crt CApath: none
- Unable to load client key -8178.
- Error NSS -8178
- Closing Connection # 0
- Problem with local SSL certificate
CURL * rot; CURLcode res;
//static const char *pClientCert = "/home/wh/work/sslkey/user1.pem"; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_HEADER, 1L); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_URL, "https://10.12.190.155/"); curl_easy_setopt(curl, CURLOPT_CAINFO, "/home/wh/work/sslkey/ca.crt"); curl_easy_setopt(curl,CURLOPT_SSLCERT,"/home/wh/work/sslkey/user1.pem"); res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); curl_easy_cleanup(curl); } curl_global_cleanup();
source share