Update to 7.40.1
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_PINNEDPUBLICKEY.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH CURLOPT_PINNEDPUBLICKEY 3 "27 Aug 2014" "libcurl 7.38.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_PINNEDPUBLICKEY \- set pinned public key
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PINNEDPUBLICKEY, char *pinnedpubkey);
30 .SH DESCRIPTION
31 Pass a pointer to a zero terminated string as parameter. The string should be
32 the file name of your pinned public key. The format expected is "PEM" or "DER".
33
34 When negotiating a TLS or SSL connection, the server sends a certificate
35 indicating its identity. A public key is extracted from this certificate and
36 if it does not exactly match the public key provided to this option, curl will
37 abort the connection before sending or receiving any data.
38 .SH DEFAULT
39 NULL
40 .SH PROTOCOLS
41 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3, SMTPS etc.
42 .SH EXAMPLE
43 .nf
44 CURL *curl = curl_easy_init();
45 if(curl) {
46   curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
47   curl_easy_setopt(curl, CURLOPT_PINNEDPUBLICKEY, "/etc/publickey.der");
48
49   /* Perform the request */
50   curl_easy_perform(curl);
51 }
52 .fi
53 .SH AVAILABILITY
54 If built TLS enabled. This is currently only implemented in the OpenSSL,
55 GnuTLS and GSKit backends.
56
57 Added in libcurl 7.39.0
58 .SH RETURN VALUE
59 Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or
60 CURLE_OUT_OF_MEMORY if there was insufficient heap space.
61 .SH "SEE ALSO"
62 .BR CURLOPT_SSL_VERIFYPEER "(3), "
63 .BR CURLOPT_SSL_VERIFYHOST "(3), "
64 .BR CURLOPT_CAINFO "(3), "
65 .BR CURLOPT_CAPATH "(3), "