1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLINFO_SSL_VERIFYRESULT
5Section: 3
6Source: libcurl
7See-also:
8  - CURLINFO_PROXY_SSL_VERIFYRESULT (3)
9  - curl_easy_getinfo (3)
10  - curl_easy_setopt (3)
11Protocol:
12  - TLS
13TLS-backend:
14  - OpenSSL
15  - GnuTLS
16---
17
18# NAME
19
20CURLINFO_SSL_VERIFYRESULT - get the result of the certificate verification
21
22# SYNOPSIS
23
24~~~c
25#include <curl/curl.h>
26
27CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SSL_VERIFYRESULT,
28                           long *result);
29~~~
30
31# DESCRIPTION
32
33Pass a pointer to a long to receive the result of the server SSL certificate
34verification that was requested (using the CURLOPT_SSL_VERIFYPEER(3)
35option).
36
370 is a positive result. Non-zero is an error.
38
39# EXAMPLE
40
41~~~c
42int main(void)
43{
44  CURL *curl = curl_easy_init();
45  if(curl) {
46    CURLcode res;
47    long verifyresult;
48    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
49    res = curl_easy_perform(curl);
50    if(res)
51      printf("error: %s\n", curl_easy_strerror(res));
52    curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, &verifyresult);
53    printf("The peer verification said %s\n", verifyresult?
54           "BAAAD":"fine");
55    curl_easy_cleanup(curl);
56  }
57}
58~~~
59
60# AVAILABILITY
61
62Added in 7.5. Only set by the OpenSSL/libressl/boringssl and GnuTLS backends.
63
64# RETURN VALUE
65
66Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
67