CMS 3D CMS Logo

List of all members | Public Member Functions
authentication.X509CertAuth Class Reference
Inheritance diagram for authentication.X509CertAuth:

Public Member Functions

def __init__ (self, host, args, kwargs)
 

Detailed Description

Class to authenticate via Grid Certificate

Definition at line 20 of file authentication.py.

Constructor & Destructor Documentation

def authentication.X509CertAuth.__init__ (   self,
  host,
  args,
  kwargs 
)

Definition at line 22 of file authentication.py.

References cmsRelvalreport.exit.

22  def __init__(self, host, *args, **kwargs):
23  key_file = None
24  cert_file = None
25 
26  x509_path = getenv("X509_USER_PROXY", None)
27  if x509_path and exists(x509_path):
28  key_file = cert_file = x509_path
29 
30  if not key_file:
31  x509_path = getenv("X509_USER_KEY", None)
32  if x509_path and exists(x509_path):
33  key_file = x509_path
34 
35  if not cert_file:
36  x509_path = getenv("X509_USER_CERT", None)
37  if x509_path and exists(x509_path):
38  cert_file = x509_path
39 
40  if not key_file:
41  x509_path = getenv("HOME") + "/.globus/userkey.pem"
42  if exists(x509_path):
43  key_file = x509_path
44 
45  if not cert_file:
46  x509_path = getenv("HOME") + "/.globus/usercert.pem"
47  if exists(x509_path):
48  cert_file = x509_path
49 
50  if not key_file or not exists(key_file):
51  print >>stderr, "No certificate private key file found"
52  exit(1)
53 
54  if not cert_file or not exists(cert_file):
55  print >>stderr, "No certificate public key file found"
56  exit(1)
57 
58  #print "Using SSL private key", key_file
59  #print "Using SSL public key", cert_file
60 
61  HTTPSConnection.__init__(self,
62  host,
63  key_file = key_file,
64  cert_file = cert_file,
65  **kwargs)
66 
67 #-----------------------------------------------------------------------------
68 
def __init__(self, host, args, kwargs)