From 1cf5811814a376415dab77983452d03b4c549500 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Sep 07 2015 10:40:11 +0000 Subject: Resolves: #1260408 - introduce CURL_SSLVERSION_TLSv1_[0-2] --- diff --git a/pycurl-7.19.5.1-tls12.patch b/pycurl-7.19.5.1-tls12.patch new file mode 100644 index 0000000..7dd2169 --- /dev/null +++ b/pycurl-7.19.5.1-tls12.patch @@ -0,0 +1,59 @@ +From 74f8a046fbb85b07f82357679c397f28ff6f839a Mon Sep 17 00:00:00 2001 +From: Oleg Pudeyev +Date: Tue, 19 May 2015 11:41:27 -0400 +Subject: [PATCH] Add libcurl 7.34.0 sslversion options + +Upstream-commit: 83ccaa22e824b1bd9d2c60cab10dff323c7d0ca4 +Signed-off-by: Kamil Dudka +--- + src/module.c | 7 ++++++- + tests/option_constants_test.py | 16 ++++++++++++++++ + 2 files changed, 22 insertions(+), 1 deletion(-) + +diff --git a/src/module.c b/src/module.c +index d7c776f..e5f23f2 100644 +--- a/src/module.c ++++ b/src/module.c +@@ -789,9 +789,14 @@ initpycurl(void) + + /* constants for setopt(SSLVERSION, x) */ + insint_c(d, "SSLVERSION_DEFAULT", CURL_SSLVERSION_DEFAULT); +- insint_c(d, "SSLVERSION_TLSv1", CURL_SSLVERSION_TLSv1); + insint_c(d, "SSLVERSION_SSLv2", CURL_SSLVERSION_SSLv2); + insint_c(d, "SSLVERSION_SSLv3", CURL_SSLVERSION_SSLv3); ++ insint_c(d, "SSLVERSION_TLSv1", CURL_SSLVERSION_TLSv1); ++#if LIBCURL_VERSION_NUM >= 0x072200 /* check for 7.34.0 or greater */ ++ insint_c(d, "SSLVERSION_TLSv1_0", CURL_SSLVERSION_TLSv1_0); ++ insint_c(d, "SSLVERSION_TLSv1_1", CURL_SSLVERSION_TLSv1_1); ++ insint_c(d, "SSLVERSION_TLSv1_2", CURL_SSLVERSION_TLSv1_2); ++#endif + + /* curl_TimeCond: constants for setopt(TIMECONDITION, x) */ + insint_c(d, "TIMECONDITION_NONE", CURL_TIMECOND_NONE); +diff --git a/tests/option_constants_test.py b/tests/option_constants_test.py +index cdba4a5..26557b2 100644 +--- a/tests/option_constants_test.py ++++ b/tests/option_constants_test.py +@@ -147,3 +147,19 @@ class OptionConstantsTest(unittest.TestCase): + curl = pycurl.Curl() + curl.setopt(curl.MAIL_AUTH, 'hello@world.com') + curl.close() ++ ++ def test_sslversion_options(self): ++ curl = pycurl.Curl() ++ curl.setopt(curl.SSLVERSION, curl.SSLVERSION_DEFAULT) ++ curl.setopt(curl.SSLVERSION, curl.SSLVERSION_SSLv2) ++ curl.setopt(curl.SSLVERSION, curl.SSLVERSION_SSLv3) ++ curl.setopt(curl.SSLVERSION, curl.SSLVERSION_TLSv1) ++ curl.close() ++ ++ @util.min_libcurl(7, 34, 0) ++ def test_sslversion_7_34_0(self): ++ curl = pycurl.Curl() ++ curl.setopt(curl.SSLVERSION, curl.SSLVERSION_TLSv1_0) ++ curl.setopt(curl.SSLVERSION, curl.SSLVERSION_TLSv1_1) ++ curl.setopt(curl.SSLVERSION, curl.SSLVERSION_TLSv1_2) ++ curl.close() +-- +2.4.6 + diff --git a/python-pycurl.spec b/python-pycurl.spec index 593d961..8478bff 100644 --- a/python-pycurl.spec +++ b/python-pycurl.spec @@ -3,7 +3,7 @@ Name: python-pycurl Version: 7.19.5.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Python interface to libcurl Group: Development/Languages @@ -11,6 +11,9 @@ License: LGPLv2+ or MIT URL: http://pycurl.sourceforge.net/ Source0: http://pycurl.sourceforge.net/download/pycurl-%{version}.tar.gz +# introduce CURL_SSLVERSION_TLSv1_[0-2] (#1260408) +Patch1: pycurl-7.19.5.1-tls12.patch + Requires: keyutils-libs BuildRequires: python-devel BuildRequires: python3-devel @@ -53,6 +56,7 @@ of features. %prep %setup0 -q -n pycurl-%{version} +%patch1 -p1 # temporarily exclude failing test-cases rm -f tests/{post_test,reset_test}.py @@ -97,6 +101,9 @@ rm -rf %{buildroot}%{_datadir}/doc/pycurl %{python3_sitearch}/* %changelog +* Mon Sep 07 2015 Kamil Dudka - 7.19.5.1-3 +- introduce CURL_SSLVERSION_TLSv1_[0-2] (#1260408) + * Thu Jun 18 2015 Fedora Release Engineering - 7.19.5.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild