4 def make_cert_handler(key_file=None, cert_file=None):
8 class HTTPSCertConnection(httplib.HTTPSConnection):
9 def __init__(self, host):
10 httplib.HTTPSConnection.__init__(self, host,
14 class HTTPSCertHandler(mechanize.HTTPSHandler):
15 def https_open(self, req):
16 return self.do_open(HTTPSCertConnection, req)
18 return HTTPSCertHandler
20 cj = mechanize.CookieJar()
22 cert_handler = make_cert_handler("cert.pem")
23 opener = mechanize.build_opener(mechanize.HTTPRedirectHandler, cert_handler, mechanize.HTTPCookieProcessor(cj))
24 mechanize.install_opener(opener)
26 b = mechanize.Browser()
27 b.set_handle_robots(False)
28 b.addheaders = [("Accept-Language", "en-us,en;q=0.5"),]
29 b.open("https://jira.mit.edu/jira/secure/Dashboard.jsp://jira.mit.edu/jira/secure/Dashboard.jspa")
30 b.follow_link(text="MIT Touchstone")