Using client certificates with urllib2
I need to create a secure channel between my server and a remote web service. I'll be using HTTPS with a client certificate. I'll also need to validate the certificate presented by the remote service. How can I use my own client certificate with urllib2? What will I need to do in my code to ensure that the remote certificate is correct? Here's a bug in the official Python bugtracker that looks relevant, and has a proposed patch. Because alex's answer is a link, and the code on that page is poorly formatted, I'm just going to put this here for posterity: import urllib2, httplib class