Permalink
Browse files

Enable use of https_connection_factory for non-secure connections also.

- It's extremely nice to be able to overload the http connection object
  and since this  parameter already exists for https, its nice to be
  able to reuse it without adding yet another parameter. Can't rename
  it more generally though as there are probably many users.
  • Loading branch information...
1 parent d409c0c commit 27c772d4123c05f6d79813c86f013f9a568af0b0 Thomas O'Dowd committed Jun 7, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 boto/connection.py
View
@@ -625,7 +625,13 @@ def new_http_connection(self, host, is_secure):
else:
boto.log.debug('establishing HTTP connection: kwargs=%s' %
self.http_connection_kwargs)
- connection = httplib.HTTPConnection(host,
+ if self.https_connection_factory:
+ # even though the factory says https, this is too handy
+ # to not be able to allow overriding for http also.
+ connection = self.https_connection_factory(host,
+ **self.http_connection_kwargs)
+ else:
+ connection = httplib.HTTPConnection(host,
**self.http_connection_kwargs)
if self.debug > 1:
connection.set_debuglevel(self.debug)

0 comments on commit 27c772d

Please sign in to comment.