Revert "Update to 7.44.0"
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_SSL_CTX_FUNCTION.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_SSL_CTX_FUNCTION 3 "19 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_SSL_CTX_FUNCTION \- openssl specific callback to do SSL magic
26 .SH SYNOPSIS
27 .nf
28 #include <curl/curl.h>
29
30 CURLcode ssl_ctx_callback(CURL *curl, void *ssl_ctx, void *userptr);
31
32 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_CTX_FUNCTION,
33                           ssl_ctx_callback);
34 .SH DESCRIPTION
35 This option only works for libcurl powered by OpenSSL. If libcurl was built
36 against another SSL library, this functionality is absent.
37
38 Pass a pointer to your callback function, which should match the prototype
39 shown above.
40
41 This callback function gets called by libcurl just before the initialization
42 of a SSL connection after having processed all other SSL related options to
43 give a last chance to an application to modify the behaviour of openssl's ssl
44 initialization. The \fIsslctx\fP parameter is actually a pointer to an openssl
45 \fISSL_CTX\fP. If an error is returned from the callback, no attempt to
46 establish a connection is made and the perform operation will return the error
47 code.  Set the \fIuserptr\fP argument with the \fICURLOPT_SSL_CTX_DATA(3)\fP
48 option.
49
50 This function will get called on all new connections made to a server, during
51 the SSL negotiation. The SSL_CTX pointer will be a new one every time.
52
53 To use this properly, a non-trivial amount of knowledge of the openssl
54 libraries is necessary. For example, using this function allows you to use
55 openssl callbacks to add additional validation code for certificates, and even
56 to change the actual URI of a HTTPS request (example used in the lib509 test
57 case).  See also the example section for a replacement of the key, certificate
58 and trust file settings.
59 .SH DEFAULT
60 NULL
61 .SH PROTOCOLS
62 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3, SMTPS etc.
63 .SH EXAMPLE
64 TODO
65 .SH AVAILABILITY
66 Added in 7.11.0. Only supported when built with OpenSSL.
67 .SH RETURN VALUE
68 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
69 .SH "SEE ALSO"
70 .BR CURLOPT_SSL_CTX_DATA "(3), " CURLOPT_SSL_VERIFYPEER "(3), "