File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/DIRAC/Core/Tornado/Server/private Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -728,13 +728,17 @@ def _authzSSL(self):
728
728
# If 'IOStream' object has no attribute 'get_ssl_certificate'
729
729
derCert = None
730
730
731
+ # Boolean whether we are behind a balancer and can trust headers
732
+ balancer = gConfig .getValue ("/WebApp/Balancer" , "none" ) != "none"
733
+
731
734
# Get client certificate as pem
732
735
if derCert :
733
736
chainAsText = derCert .as_pem ().decode ("ascii" )
734
737
# Read all certificate chain
735
738
chainAsText += "" .join ([cert .as_pem ().decode ("ascii" ) for cert in self .request .get_ssl_certificate_chain ()])
736
- elif self .request .headers .get ("X-Ssl_client_verify" ) == "SUCCESS" and self .request .headers .get ("X-SSL-CERT" ):
737
- chainAsText = unquote (self .request .headers .get ("X-SSL-CERT" ))
739
+ elif balancer :
740
+ if self .request .headers .get ("X-Ssl_client_verify" ) == "SUCCESS" and self .request .headers .get ("X-SSL-CERT" ):
741
+ chainAsText = unquote (self .request .headers .get ("X-SSL-CERT" ))
738
742
else :
739
743
return S_ERROR (DErrno .ECERTFIND , "Valid certificate not found." )
740
744
You can’t perform that action at this time.
0 commit comments