simplegeo / python-simplegeo

A client interface for SimpleGeo's API.
http://simplegeo.com
104 stars 18 forks source link

SSL with tests #8

Closed aguynamedben closed 13 years ago

aguynamedben commented 13 years ago

I used this approach: http://stackoverflow.com/questions/2363105/how-to-do-mutual-certificate-authentication-with-httplib2

...but in an attempt to use the OS's root CA certificates, I am NOT passing a ca_cert argument to ssl.wrap_socket. I assume that this means the root certificate is used, but I'm not yet sure how to check.

self.sock = ssl.wrap_socket(sock,
                        self.key_file,
                        self.cert_file,
                        cert_reqs=ssl.CERT_REQUIRED,
                        ***ca_certs=ca_cert_file***
                        )

The socks library is unreliable from pip/easy_install/PyPI, and it's only 1 file, so I just included it in a contrib directory.

I also had a bit of a doozy fixing up the 45 broken tests because client.http was being mocked all over the place. Learned how that worked and fixed it.

JeremyGrosser commented 13 years ago

I thought we were gonna have an option to disable SSL for testing?

aguynamedben commented 13 years ago

Never discussed that with anyone, but we can sure.