diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2015-02-14 16:57:07 +0100 |
---|---|---|
committer | Kamil Dudka <kdudka@redhat.com> | 2015-03-20 20:14:33 +0100 |
commit | 4dcd25e138e9c18a4c96cb78bca5749d8431699f (patch) | |
tree | d061485adaefcfea53e76e599b1e98da63ad776a /lib | |
parent | a332922a526f91876fc8ffa73a45322800bf0e73 (diff) |
url: add CURLOPT_SSL_FALSESTART option
This option can be used to enable/disable TLS False Start defined in the RFC
draft-bmoeller-tls-falsestart.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/url.c | 11 | ||||
-rw-r--r-- | lib/urldata.h | 1 | ||||
-rw-r--r-- | lib/vtls/vtls.c | 12 | ||||
-rw-r--r-- | lib/vtls/vtls.h | 3 |
4 files changed, 27 insertions, 0 deletions
@@ -2027,6 +2027,17 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, result = CURLE_NOT_BUILT_IN; #endif break; + case CURLOPT_SSL_FALSESTART: + /* + * Enable TLS false start. + */ + if(!Curl_ssl_false_start()) { + result = CURLE_NOT_BUILT_IN; + break; + } + + data->set.ssl.falsestart = (0 != va_arg(param, long))?TRUE:FALSE; + break; case CURLOPT_CERTINFO: #ifdef have_curlssl_certinfo data->set.ssl.certinfo = (0 != va_arg(param, long))?TRUE:FALSE; diff --git a/lib/urldata.h b/lib/urldata.h index caa5debf1..01415b6ab 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -351,6 +351,7 @@ struct ssl_config_data { void *fsslctxp; /* parameter for call back */ bool sessionid; /* cache session IDs or not */ bool certinfo; /* gather lots of certificate info */ + bool falsestart; #ifdef USE_TLS_SRP char *username; /* TLS username (for, e.g., SRP) */ diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 2230a0433..c551cca66 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -857,4 +857,16 @@ bool Curl_ssl_cert_status_request(void) #endif } +/* + * Check whether the SSL backend supports false start. + */ +bool Curl_ssl_false_start(void) +{ +#ifdef curlssl_false_start + return curlssl_false_start(); +#else + return FALSE; +#endif +} + #endif /* USE_SSL */ diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index bbaa8505f..1a5f54fe4 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -118,6 +118,8 @@ CURLcode Curl_pin_peer_pubkey(const char *pinnedpubkey, bool Curl_ssl_cert_status_request(void); +bool Curl_ssl_false_start(void); + #define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */ #else @@ -145,6 +147,7 @@ bool Curl_ssl_cert_status_request(void); #define Curl_ssl_kill_session(x) Curl_nop_stmt #define Curl_ssl_random(x,y,z) ((void)x, CURLE_NOT_BUILT_IN) #define Curl_ssl_cert_status_request() FALSE +#define Curl_ssl_false_start() FALSE #endif #endif /* HEADER_CURL_VTLS_H */ |