except ImportError:
ssl = None
+_DEFAULT_CA_CERTS = os.path.dirname(__file__) + '/ca-certificates.crt'
+
class SimpleAsyncHTTPClient(object):
"""Non-blocking HTTP client with no external dependencies.
if request.ca_certs is not None:
ssl_options["ca_certs"] = request.ca_certs
else:
- ssl_options["ca_certs"] = (os.path.dirname(__file__) +
- '/ca-certificates.crt')
+ ssl_options["ca_certs"] = _DEFAULT_CA_CERTS
self.stream = SSLIOStream(socket.socket(),
io_loop=self.io_loop,
ssl_options=ssl_options)
from contextlib import closing
from tornado.ioloop import IOLoop
-from tornado.simple_httpclient import SimpleAsyncHTTPClient
+from tornado.simple_httpclient import SimpleAsyncHTTPClient, _DEFAULT_CA_CERTS
from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase, get_unused_port
from tornado.web import Application, RequestHandler, asynchronous, url
self.assertTrue(response.effective_url.endswith("/countdown/2"))
self.assertTrue(response.headers["Location"].endswith("/countdown/1"))
+ def test_default_certificates_exist(self):
+ open(_DEFAULT_CA_CERTS)
+