Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request protocol 'HTTP/1.1' is not supported - Net Framework #2510

Open
gktval opened this issue Aug 15, 2024 · 0 comments
Open

Request protocol 'HTTP/1.1' is not supported - Net Framework #2510

gktval opened this issue Aug 15, 2024 · 0 comments
Labels
question Further information is requested

Comments

@gktval
Copy link

gktval commented Aug 15, 2024

I have a grpc server/client connection that works for several hundred people. However, I am running into an issue where there are a few clients that cannot connect and are receiving the error Request protocol 'HTTP/1.1' is not supported. I haven't been able to figure out, yet, why it might work for the majority of people, but a few are having issues.

The client software is in .Net Framework 4.7. Below is the code for creating the channel:

public string Token { get; set; }
_dataServiceAddress = "https://www.mysite.com:5001";

public GrpcChannel CreateDataChannel()
{
    var credentials = CallCredentials.FromInterceptor((context, metadata) =>
    {
        if (!string.IsNullOrEmpty(Token))
        {
            metadata.Add("Authorization", $"Bearer {Token}");
        }
        return Task.CompletedTask;
    });

    var winhttpHandler = new WinHttpHandler()
    {
          ServerCertificateValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator,
    };
    SubdirectoryHandler handler = new SubdirectoryHandler(winhttpHandler, "/MySubDir");

    var httpClient = new HttpClient(handler);

    var channel = GrpcChannel.ForAddress(_dataServiceAddress, new GrpcChannelOptions
    {
        Credentials = ChannelCredentials.Create(new SslCredentials(), credentials),
        HttpClient = httpClient,
    });

    return channel;
}

Any thoughts on what to ask or find out from the user that they would not be able to connect to the gRPC channel?

Their computer is running Windows 10.

@gktval gktval added the question Further information is requested label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant