15 from os.path
import exists
16 from httplib
import HTTPSConnection
17 from urllib2
import AbstractHTTPHandler
21 '''Class to authenticate via Grid Certificate''' 26 x509_path = getenv(
"X509_USER_PROXY",
None)
27 if x509_path
and exists(x509_path):
28 key_file = cert_file = x509_path
31 x509_path = getenv(
"X509_USER_KEY",
None)
32 if x509_path
and exists(x509_path):
36 x509_path = getenv(
"X509_USER_CERT",
None)
37 if x509_path
and exists(x509_path):
41 x509_path = getenv(
"HOME") +
"/.globus/userkey.pem" 46 x509_path = getenv(
"HOME") +
"/.globus/usercert.pem" 50 if not key_file
or not exists(key_file):
51 print >>stderr,
"No certificate private key file found" 54 if not cert_file
or not exists(cert_file):
55 print >>stderr,
"No certificate public key file found" 61 HTTPSConnection.__init__(self,
64 cert_file = cert_file,
71 return self.do_open(X509CertAuth, req)
def default_open(self, req)
def __init__(self, host, args, kwargs)