1 from __future__
import print_function
16 from os.path
import exists
17 from httplib
import HTTPSConnection
18 from urllib2
import AbstractHTTPHandler
22 '''Class to authenticate via Grid Certificate''' 27 x509_path = getenv(
"X509_USER_PROXY",
None)
28 if x509_path
and exists(x509_path):
29 key_file = cert_file = x509_path
32 x509_path = getenv(
"X509_USER_KEY",
None)
33 if x509_path
and exists(x509_path):
37 x509_path = getenv(
"X509_USER_CERT",
None)
38 if x509_path
and exists(x509_path):
42 x509_path = getenv(
"HOME") +
"/.globus/userkey.pem" 47 x509_path = getenv(
"HOME") +
"/.globus/usercert.pem" 51 if not key_file
or not exists(key_file):
52 print(
"No certificate private key file found", file=stderr)
55 if not cert_file
or not exists(cert_file):
56 print(
"No certificate public key file found", file=stderr)
62 HTTPSConnection.__init__(self,
65 cert_file = cert_file,
72 return self.do_open(X509CertAuth, req)
S & print(S &os, JobReport::InputFile const &f)
def default_open(self, req)
def __init__(self, host, args, kwargs)