Fix for an Issue #125

This commit is contained in:
Miroslav Stampar
2012-07-31 13:06:45 +02:00
parent 6f529542e3
commit f797a6d813
2 changed files with 12 additions and 8 deletions

View File

@@ -993,6 +993,15 @@ def __setPrefixSuffix():
# to be tested for
conf.boundaries = [ boundary ]
def __setAuthCred():
"""
Adds authentication credentials (if any) for current target to the password manager
(used by connection handler)
"""
if kb.passwordMgr:
kb.passwordMgr.add_password(None, "%s://%s" % (conf.scheme, conf.hostname), conf.authUsername, conf.authPassword)
def __setHTTPAuthentication():
"""
Check and set the HTTP(s) authentication method (Basic, Digest, NTLM or Certificate),
@@ -1044,6 +1053,8 @@ def __setHTTPAuthentication():
kb.passwordMgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
__setAuthCred()
if aTypeLower == "basic":
authHandler = SmartHTTPBasicAuthHandler(kb.passwordMgr)