1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_SSLENGINE_DEFAULT
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_SSLCERT (3)
9  - CURLOPT_SSLENGINE (3)
10Protocol:
11  - TLS
12TLS-backend:
13  - OpenSSL
14---
15
16# NAME
17
18CURLOPT_SSLENGINE_DEFAULT - make SSL engine default
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSLENGINE_DEFAULT, long val);
26~~~
27
28# DESCRIPTION
29
30Pass a long set to 1 to make the already specified crypto engine the default
31for (asymmetric) crypto operations.
32
33This option has no effect unless set after CURLOPT_SSLENGINE(3).
34
35# DEFAULT
36
37None
38
39# EXAMPLE
40
41~~~c
42int main(void)
43{
44  CURL *curl = curl_easy_init();
45  if(curl) {
46    CURLcode res;
47    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
48    curl_easy_setopt(curl, CURLOPT_SSLENGINE, "dynamic");
49    curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT, 1L);
50    res = curl_easy_perform(curl);
51    curl_easy_cleanup(curl);
52  }
53}
54~~~
55
56# AVAILABILITY
57
58Only if the SSL backend is OpenSSL built with engine support.
59
60# RETURN VALUE
61
62CURLE_OK - Engine set as default.
63
64CURLE_SSL_ENGINE_SETFAILED - Engine could not be set as default.
65
66CURLE_NOT_BUILT_IN - Option not built in, OpenSSL is not the SSL backend.
67
68CURLE_UNKNOWN_OPTION - Option not recognized.
69
70CURLE_OUT_OF_MEMORY - Insufficient heap space.
71