1 from __future__
import print_function
15 from sys
import version_info
17 from os.path
import exists
18 if version_info[0]==2:
19 from httplib
import HTTPSConnection
20 from urllib2
import AbstractHTTPHandler
22 from http.client
import HTTPSConnection
23 from urllib.request
import AbstractHTTPHandler
27 '''Class to authenticate via Grid Certificate'''
32 x509_path = getenv(
"X509_USER_PROXY",
None)
33 if x509_path
and exists(x509_path):
34 key_file = cert_file = x509_path
37 x509_path = getenv(
"X509_USER_KEY",
None)
38 if x509_path
and exists(x509_path):
42 x509_path = getenv(
"X509_USER_CERT",
None)
43 if x509_path
and exists(x509_path):
47 x509_path = getenv(
"HOME") +
"/.globus/userkey.pem"
52 x509_path = getenv(
"HOME") +
"/.globus/usercert.pem"
56 if not key_file
or not exists(key_file):
57 print(
"No certificate private key file found", file=stderr)
60 if not cert_file
or not exists(cert_file):
61 print(
"No certificate public key file found", file=stderr)
67 HTTPSConnection.__init__(self,
70 cert_file = cert_file,
77 return self.do_open(X509CertAuth, req)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)