sta / sta/websocket-sharp

Error when proxy server offers multiple authentication methods

Open
#530 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Hi,
I am behind a corporate proxy server with password authentication. Our proxy server offers multiple authentication methods. It's message is:
Proxy-Authenticate: NEGOTIATE,NTLM,BASIC realm="abcde"
In this case websocket-sharp fails to connect because the method Parse expects exactly one authentication method offered by the proxy server.
I made a workaround by using a string search. Can you include it in the master version?

internal static AuthenticationChallenge Parse (string value)
{
      var chal = value.Split (new[] { ' ' }, 2);
      if (chal.Length != 2)
        return null;
      var schm = chal[0].ToLower();
        return schm.Contains("basic")
                ? new AuthenticationChallenge(
                    AuthenticationSchemes.Basic, ParseParameters(chal[1]))
                : schm.Contains("digest")
                    ? new AuthenticationChallenge(
                        AuthenticationSchemes.Digest, ParseParameters(chal[1]))
                    : null;
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for AuthenticationChallenge.Parse and inspect how proxy authentication headers are processed. Verify the behavior with a Proxy-Authenticate header containing multiple methods, including the reported NEGOTIATE,NTLM,BASIC value; done means a supported Basic or Digest method can still be selected instead of returning no challenge.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.