@@ -1095,7 +1095,7 @@ def _setHTTPAuthentication():
10951095 if not conf .aType and not conf .aCred and not conf .aCert :
10961096 return
10971097
1098- elif conf .aType and not conf .aCred :
1098+ elif conf .aType and not conf .aCred and not conf . aCert :
10991099 errMsg = "you specified the HTTP authentication type, but "
11001100 errMsg += "did not provide the credentials"
11011101 raise SqlmapSyntaxException (errMsg )
@@ -1111,18 +1111,22 @@ def _setHTTPAuthentication():
11111111
11121112 aTypeLower = conf .aType .lower ()
11131113
1114- if aTypeLower not in (AUTH_TYPE .BASIC , AUTH_TYPE .DIGEST , AUTH_TYPE .NTLM ):
1114+ if aTypeLower not in (AUTH_TYPE .BASIC , AUTH_TYPE .DIGEST , AUTH_TYPE .NTLM , AUTH_TYPE . CERT ):
11151115 errMsg = "HTTP authentication type value must be "
1116- errMsg += "Basic, Digest or NTLM "
1116+ errMsg += "Basic, Digest, NTLM or Cert "
11171117 raise SqlmapSyntaxException (errMsg )
11181118 elif aTypeLower in (AUTH_TYPE .BASIC , AUTH_TYPE .DIGEST ):
11191119 regExp = "^(.*?):(.*?)$"
11201120 errMsg = "HTTP %s authentication credentials " % aTypeLower
1121- errMsg += "value must be in format username:password"
1121+ errMsg += "value must be in format ' username:password' "
11221122 elif aTypeLower == AUTH_TYPE .NTLM :
11231123 regExp = "^(.*\\ \\ .*):(.*?)$"
11241124 errMsg = "HTTP NTLM authentication credentials value must "
1125- errMsg += "be in format DOMAIN\username:password"
1125+ errMsg += "be in format 'DOMAIN\username:password'"
1126+ elif aTypeLower == AUTH_TYPE .CERT :
1127+ errMsg = "HTTP Cert authentication require "
1128+ errMsg += "usage of option `--auth-cert`"
1129+ raise SqlmapSyntaxException (errMsg )
11261130
11271131 aCredRegExp = re .search (regExp , conf .aCred )
11281132
@@ -1160,7 +1164,7 @@ def _setHTTPAuthentication():
11601164
11611165 if not aCertRegExp :
11621166 errMsg = "HTTP authentication certificate option "
1163- errMsg += "must be in format key_file,cert_file"
1167+ errMsg += "must be in format ' key_file,cert_file' "
11641168 raise SqlmapSyntaxException (errMsg )
11651169
11661170 # os.path.expanduser for support of paths with ~
@@ -1169,7 +1173,7 @@ def _setHTTPAuthentication():
11691173
11701174 for ifile in (key_file , cert_file ):
11711175 if not os .path .exists (ifile ):
1172- errMsg = "File '%s' does not exist" % ifile
1176+ errMsg = "file '%s' does not exist" % ifile
11731177 raise SqlmapSyntaxException (errMsg )
11741178
11751179 authHandler = HTTPSCertAuthHandler (key_file , cert_file )
0 commit comments