taf2 / curb

Ruby bindings for libcurl
Other
1.29k stars 229 forks source link

Define CURL_SSLVERSION_MAX_* constants #412

Closed xgatron closed 4 years ago

xgatron commented 4 years ago

During handshake curl tries to raise TLS version to current "safe" value (v1.3 in my case), but server cannot handle this version properly and connection fails. This patch adds curl constants which allow to limit maximum TLS version using "ssl_version=" method. Example:

curl.ssl_version = Curl::CURL_SSLVERSION_MAX_TLSv1_2
# curl allows to OR one of the CURL_SSLVERSION_ constant with one of the CURL_SSLVERSION_MAX_ constant.
curl.ssl_version = Curl::CURL_SSLVERSION_TLSv1_1 | Curl::CURL_SSLVERSION_MAX_TLSv1_2

CURL_SSLVERSIONMAX constants were added in curl 7.54.0