xref: /curl/docs/libcurl/opts/CURLOPT_SSLENGINE.md (revision c4ab3337)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_SSLENGINE
5Section: 3
6Source: libcurl
7See-also:
8  - CURLINFO_SSL_ENGINES (3)
9  - CURLOPT_SSLENGINE_DEFAULT (3)
10  - CURLOPT_SSLKEY (3)
11Protocol:
12  - TLS
13TLS-backend:
14  - OpenSSL
15Added-in: 7.9.3
16---
17
18# NAME
19
20CURLOPT_SSLENGINE - SSL engine identifier
21
22# SYNOPSIS
23
24~~~c
25#include <curl/curl.h>
26
27CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSLENGINE, char *id);
28~~~
29
30# DESCRIPTION
31
32Pass a pointer to a null-terminated string as parameter. It is used as the
33identifier for the crypto engine you want to use for your private key.
34
35The application does not have to keep the string around after setting this
36option.
37
38Using this option multiple times makes the last set string override the
39previous ones. Set it to NULL to disable its use again.
40
41# DEFAULT
42
43NULL
44
45# %PROTOCOLS%
46
47# EXAMPLE
48
49~~~c
50int main(void)
51{
52  CURL *curl = curl_easy_init();
53  if(curl) {
54    CURLcode res;
55    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
56    curl_easy_setopt(curl, CURLOPT_SSLENGINE, "dynamic");
57    res = curl_easy_perform(curl);
58    curl_easy_cleanup(curl);
59  }
60}
61~~~
62
63# %AVAILABILITY%
64
65# RETURN VALUE
66
67CURLE_OK - Engine found.
68
69CURLE_SSL_ENGINE_NOTFOUND - Engine not found, or OpenSSL was not built with
70engine support.
71
72CURLE_SSL_ENGINE_INITFAILED - Engine found but initialization failed.
73
74CURLE_NOT_BUILT_IN - Option not built in, OpenSSL is not the SSL backend.
75
76CURLE_UNKNOWN_OPTION - Option not recognized.
77
78CURLE_OUT_OF_MEMORY - Insufficient heap space.
79