void-packages/srcpkgs/python-tornado/patches/01_use-system-ca-certificates.patch

57 lines
2.1 KiB
Diff

diff --git setup.py setup.py
index f09169f..d42c486 100644
--- setup.py
+++ setup.py
@@ -120,7 +120,7 @@ if (platform.python_implementation() == 'CPython' and
if setuptools is not None:
# If setuptools is not available, you're on your own for dependencies.
- install_requires = ['certifi']
+ install_requires = []
if sys.version_info < (3, 2):
install_requires.append('backports.ssl_match_hostname')
kwargs['install_requires'] = install_requires
diff --git tornado/simple_httpclient.py tornado/simple_httpclient.py
index f0f73fa..ffe3e40 100644
--- tornado/simple_httpclient.py
+++ tornado/simple_httpclient.py
@@ -33,17 +33,9 @@ except ImportError:
# ssl is not available on Google App Engine.
ssl = None
-try:
- import certifi
-except ImportError:
- certifi = None
-
def _default_ca_certs():
- if certifi is None:
- raise Exception("The 'certifi' package is required to use https "
- "in simple_httpclient")
- return certifi.where()
+ return "/etc/ssl/certs/ca-certificates.crt"
class SimpleAsyncHTTPClient(AsyncHTTPClient):
diff --git tornado/test/iostream_test.py tornado/test/iostream_test.py
index 01b0d95..47a64e7 100644
--- tornado/test/iostream_test.py
+++ tornado/test/iostream_test.py
@@ -10,7 +10,6 @@ from tornado.stack_context import NullContext
from tornado.testing import AsyncHTTPTestCase, AsyncHTTPSTestCase, AsyncTestCase, bind_unused_port, ExpectLog, gen_test
from tornado.test.util import unittest, skipIfNonUnix
from tornado.web import RequestHandler, Application
-import certifi
import errno
import logging
import os
@@ -855,7 +854,7 @@ class TestIOStreamStartTLS(AsyncTestCase):
def test_handshake_fail(self):
self.server_start_tls(_server_ssl_options())
client_future = self.client_start_tls(
- dict(cert_reqs=ssl.CERT_REQUIRED, ca_certs=certifi.where()))
+ dict(cert_reqs=ssl.CERT_REQUIRED, ca_certs="/etc/ssl/certs/ca-certificates.crt"))
with ExpectLog(gen_log, "SSL Error"):
with self.assertRaises(ssl.SSLError):
yield client_future