aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-05-01 17:05:38 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-05-01 17:05:38 +0200
commit283babfaf8d8f3bab9d3c63cea94eb0b84e79c37 (patch)
tree78f3a526d4afe2c60c1e6f26dfabc5d61cd42f79 /lib/url.c
parent100c7b478fd17fd0c3ffacda7d6aa4b536bc7c6e (diff)
tls: make setting pinnedkey option fail if not supported
to make it obvious to users trying to use the feature with TLS backends not supporting it. Discussed in #781 Reported-by: Travis Burtrum
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index feffb7fb4..b1453e697 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2072,12 +2072,16 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
#endif
break;
case CURLOPT_PINNEDPUBLICKEY:
+#ifdef have_curlssl_pinnedpubkey /* only by supported backends */
/*
* Set pinned public key for SSL connection.
* Specify file name of the public key in DER format.
*/
result = setstropt(&data->set.str[STRING_SSL_PINNEDPUBLICKEY],
va_arg(param, char *));
+#else
+ result = CURLE_NOT_BUILT_IN;
+#endif
break;
case CURLOPT_CAINFO:
/*