diff options
author | Scott Talbert <swt@techie.net> | 2022-08-03 18:49:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-03 18:49:52 -0400 |
commit | 39f4ceb33e292f2a2d9e3d76a6612a7f9fdb2855 (patch) | |
tree | fc0e75864f880d1c9fe4394b5548ecccfeecb4b6 | |
parent | 1cb3a9586596de28a15c58fa98e0b04d02a19299 (diff) | |
parent | a1e6f466e21b8c64d379bc87048fc712ee8a887b (diff) | |
download | pycurl-39f4ceb33e292f2a2d9e3d76a6612a7f9fdb2855.tar.gz |
Merge pull request #767 from swt2c/tls_ciphers
Add CURLOPT_TLS13_CIPHERS and CURLOPT_PROXY_TLS13_CIPHERS options
-rw-r--r-- | src/easyopt.c | 4 | ||||
-rw-r--r-- | src/module.c | 4 | ||||
-rw-r--r-- | tests/option_constants_test.py | 14 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/easyopt.c b/src/easyopt.c index e3da86b..faa0649 100644 --- a/src/easyopt.c +++ b/src/easyopt.c @@ -314,6 +314,10 @@ do_curl_setopt_string_impl(CurlObject *self, int option, PyObject *obj) case CURLOPT_PROXY_SSLKEY: case CURLOPT_PROXY_SSLKEYTYPE: #endif +#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 61, 0) + case CURLOPT_TLS13_CIPHERS: + case CURLOPT_PROXY_TLS13_CIPHERS: +#endif #if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 62, 0) case CURLOPT_DOH_URL: #endif diff --git a/src/module.c b/src/module.c index b520eb4..8efeab3 100644 --- a/src/module.c +++ b/src/module.c @@ -1077,6 +1077,10 @@ initpycurl(void) #if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 45, 0) insint_c(d, "DEFAULT_PROTOCOL", CURLOPT_DEFAULT_PROTOCOL); #endif +#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 61, 0) + insint_c(d, "TLS13_CIPHERS", CURLOPT_TLS13_CIPHERS); + insint_c(d, "PROXY_TLS13_CIPHERS", CURLOPT_PROXY_TLS13_CIPHERS); +#endif #if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 62, 0) insint_c(d, "DOH_URL", CURLOPT_DOH_URL); #endif diff --git a/tests/option_constants_test.py b/tests/option_constants_test.py index 0f9b5a0..abba20e 100644 --- a/tests/option_constants_test.py +++ b/tests/option_constants_test.py @@ -379,6 +379,20 @@ class OptionConstantsTest(unittest.TestCase): curl.setopt(curl.HTTP09_ALLOWED, 1) curl.close() + @util.min_libcurl(7, 61, 0) + @util.only_ssl_backends('openssl') + def test_tls13_ciphers(self): + curl = pycurl.Curl() + curl.setopt(curl.TLS13_CIPHERS, 'TLS_CHACHA20_POLY1305_SHA256') + curl.close() + + @util.min_libcurl(7, 61, 0) + @util.only_ssl_backends('openssl') + def test_proxy_tls13_ciphers(self): + curl = pycurl.Curl() + curl.setopt(curl.PROXY_TLS13_CIPHERS, 'TLS_CHACHA20_POLY1305_SHA256') + curl.close() + class OptionConstantsSettingTest(unittest.TestCase): def setUp(self): self.curl = pycurl.Curl() |