def ssl_get_cert_from_request(request):
 certkey = 'SSL_CLIENT_S_DN'
 cert = request.META.get(certkey, '')
 if (not cert):
  cert = request.META.get(('HTTP_' + certkey), '')
 if (not cert):
  try:
   cert = request._req.subprocess_env.get(certkey, '')
  except Exception:
   return ''
 return cert

def ssl_get_cert_from_request ( request ) : certkey = 'SSL_CLIENT_S_DN' cert = request . META . get ( certkey , '' ) if ( not cert ) : cert = request . META . get ( ( 'HTTP_' + certkey ) , '' ) if ( not cert ) : try : cert = request . _req . subprocess_env . get ( certkey , '' ) except Exception : return '' return cert
extract user information from certificate .