GNURLOPT_PROXY_SSLKEY(3)
π NAME π
okay bestie, this is GNURLOPT_PROXY_SSLKEY(3), one of the curl_easy_setopt options, and the main character is CURLOPT_PROXY_SSLKEY β specify private keyfile for TLS and SSL proxy client cert. It's giving "my HTTPS proxy has a private key and she's ready to be introduced" energy. π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLKEY, char *keyfile);
π DESCRIPTION π
Pass a pointer to a null-terminated string as parameter β yes, that's the whole assignment. That string should be the file name of your private key used for connecting to the HTTPS proxy. π
The default format is "PEM" and can be changed with CURLOPT_PROXY_SSLKEYTYPE(3) β no cap.
iOS and Mac OS X only: this option is ignored if curl was built against Secure Transport. Secure Transport expects the private key to be already present in the keychain or PKCS#12 file containing the certificate. π
And the bestie-friendly part: the application does not have to keep the string around after setting this option. So you can let it go, bestie. π¦
π DEFAULT π
NULL β iconic, empty, no keyfile until you say so. π
π¦ PROTOCOLS π¦
All β literally every protocol is invited to the party. π
π EXAMPLE π
Here's the little glow-up in code form, exactly as it's meant to go:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem");
curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
π AVAILABILITY π
Added in 7.52.0 β yes, she's been around. π
If built TLS enabled.
π₯ RETURN VALUE π₯
Returns CURLE_OK if TLS is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. So like, if TLS is a no, you get the unknown-option vibe; if memory says "not today", you get the out-of-memory one. π
π«Ά SEE ALSO π«Ά
π that's the whole tea, brought to you by libcurl 7.52.0, dated 16 Nov 2016 β catch you in the group chat, bestie! GNURLOPT_PROXY_SSLKEY(3) out. πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms