Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.
/ https_shim Public archive
forked from ut-adamc/https_shim

Allows setting the SSL protocol suite (ssl.PROTOCOL_SSLv3, etc.) for an httplib.HTTPSConnection (Python 2.6/2.7).

Notifications You must be signed in to change notification settings

UT-Austin-FIS/https_shim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

https_shim

Allows setting the SSL protocol suite (ssl.PROTOCOL_SSLv3, etc.) for a subclass of httplib.HTTPSConnection (Python 2.6/2.7). Borrows from http://stackoverflow.com/a/18671399/306262 but uses subclassing instead of monkey- patching.

Example Usage

import https_shim
import ssl

conn = https_shim.HTTPSConnection('httpbin.org', '443', ssl_version=ssl.PROTOCOL_SSLv3)
conn.request('GET', '/get?foo=bar')
...

or

conn.https_shim.HTTPSConnection('httpbin.org', '443')
conn.connect(ssl_version=ssl.PROTOCOL_SSLv3)
...

See the tests if you want a few examples.

Testing

Note that this has only really been tested in Python 2.6 so far.

You can run the tests with

nosetests https_shim

If you pip install with the extra "test_support", the packages needed for running the tests will alsoo be installed (in particular, nose), e.g.,

pip install -e <path-to-https-shim>[test_support]

Releases

  • 0.10.1 (2015/02/26)
    • adding support for Python 2.7
      • this library may not be necessary as of Python 2.7.9
      • tests require Python >= 2.7
  • 0.10.0 (2013/12/19)
    • initial release with support for Python <= 2.6

About

Allows setting the SSL protocol suite (ssl.PROTOCOL_SSLv3, etc.) for an httplib.HTTPSConnection (Python 2.6/2.7).

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%