• Show log

    Commit

  • Hash : 3d11b6c5
    Author : Edward Thomson
    Date : 2019-03-11T20:36:09

    winhttp: support default credentials for proxies
    
    We did not properly support default credentials for proxies, only for
    destination servers.  Refactor the credential handling to support sending
    either username/password _or_ default credentials to either the proxy or
    the destination server.
    
    This actually shares the authentication logic between proxy servers and
    destination servers.  Due to copy/pasta drift over time, they had
    diverged.  Now they share a common logic which is: first, use
    credentials specified in the URL (if there were any), treating empty
    username and password (ie, "http://:@foo.com/") as default credentials,
    for compatibility with git.  Next, call the credential callbacks.
    Finally, fallback to WinHTTP compatibility layers using built-in
    authentication like we always have.
    
    Allowing default credentials for proxies requires moving the security
    level downgrade into the credential setting routines themselves.
    We will update our security level to "high" by default which means that
    we will never send default credentials without prompting.  (A lower
    setting, like the WinHTTP default of "medium" would allow WinHTTP to
    handle credentials for us, despite what a user may have requested with
    their structures.)  Now we start with "high" and downgrade to "low" only
    after a user has explicitly requested default credentials.