1curl_global_sslset(3) libcurl Manual curl_global_sslset(3)
2
3
4
6 curl_global_sslset - Select SSL backend to use with libcurl
7
9 #include <curl/curl.h>
10
11 typedef struct {
12 curl_sslbackend id;
13 const char *name;
14 } curl_ssl_backend;
15
16 typedef enum {
17 CURLSSLBACKEND_NONE = 0,
18 CURLSSLBACKEND_OPENSSL = 1,
19 CURLSSLBACKEND_GNUTLS = 2,
20 CURLSSLBACKEND_NSS = 3,
21 CURLSSLBACKEND_GSKIT = 5,
22 CURLSSLBACKEND_POLARSSL = 6,
23 CURLSSLBACKEND_WOLFSSL = 7,
24 CURLSSLBACKEND_SCHANNEL = 8,
25 CURLSSLBACKEND_DARWINSSL = 9,
26 CURLSSLBACKEND_AXTLS = 10,
27 CURLSSLBACKEND_MBEDTLS = 11
28 } curl_sslbackend;
29
30 CURLsslset curl_global_sslset(curl_sslbackend id,
31 const char * name,
32 curl_ssl_backend *** avail );
33
35 This function configures at runtime which SSL backend to use with
36 libcurl. This function can only be used to select an SSL backend once,
37 and it must be called before [22mcurl_global_init(3).
38
39 The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL).
40 The backend can also be specified via the name parameter for a case
41 insensitive match (passing -1 as id). If both id and name are speci‐
42 fied, the name will be ignored.
43
44 If neither id nor name are specified, the function will fail with
45 CURLSSLSET_UNKNOWN_BACKEND and set the avail pointer to the NULL-termi‐
46 nated list of available backends. The available backends are those that
47 this particular build of libcurl supports.
48
49 Since libcurl 7.60.0, the avail pointer will always be set to the list
50 of alternatives if non-NULL.
51
52 Upon success, the function returns CURLSSLSET_OK.
53
54 If the specified SSL backend is not available, the function returns
55 CURLSSLSET_UNKNOWN_BACKEND and sets the avail pointer to a NULL-termi‐
56 nated list of available SSL backends. In this case, you may call the
57 function again to try to select a different backend.
58
59 The SSL backend can be set only once. If it has already been set, a
60 subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE.
61
62 This function is not thread safe. You must not call it when any other
63 thread in the program (i.e. a thread sharing the same memory) is run‐
64 ning. This doesn't just mean no other thread that is using libcurl.
65
66
68 This function was added in libcurl 7.56.0. Before this version, there
69 was no support for choosing SSL backends at runtime.
70
72 If this function returns CURLSSLSET_OK, the backend was successfully
73 selected.
74
75 If the chosen backend is unknown (or support for the chosen backend has
76 not been compiled into libcurl), the function returns
77 CURLSSLSET_UNKNOWN_BACKEND.
78
79 If the backend had been configured previously, or if
80 curl_global_init(3) has already been called, the function returns
81 CURLSSLSET_TOO_LATE.
82
83 If this libcurl was built completely without SSL support, with no back‐
84 ends at all, this function returns CURLSSLSET_NO_BACKENDS.
85
87 curl_global_init(3), libcurl(3)
88
89
90
91libcurl 7.61.1 April 15, 2018 curl_global_sslset(3)