Skip to content

Cannot use GrpcClient with WinHttpHandler on Windows Server 2019 Domain Controllers #2467

@wrall

Description

@wrall

What version of gRPC and what language are you using?

v2.62.0, C#

What operating system (Linux, Windows,...) and version?

Windows Server 2019 Core (as a Domain Controller),
Windows Server 2022 Core (as a Domain Controller)
Windows Server 2022 (Desktop, as a Domain Controller)

What runtime / compiler are you using (e.g. .NET Core SDK version dotnet --info)

.NET Framework 4.8.1

What did you do?

Call:

            this.gRpcChannel = GrpcChannel.ForAddress($"https://localhost:{Common.Constants.GrpcServicePort}", new GrpcChannelOptions
            {
                HttpHandler = new WinHttpHandler()
                {
                    ServerCertificateValidationCallback = ServerCertificateCustomValidation,
                    EnableMultipleHttp2Connections = true
                }
            });

What did you expect to see?

Successfully-created GrpcChannel.

What did you see instead?

InvalidOperationException.

Anything else we should know about your project / environment?

Root cause: new checks added in commit cec98b28d50e81af3ed0e33487ec488723a973e9 and updated by 3103c6937fc183fab4102f40f17e6eba7bdff322 exclude Windows Server 2019 when it is configured as a Domain Controller. That was probably an oversight: instead of checking osVersionInfo.ProductType == VER_NT_SERVER in Native.cs, it should instead check osVersionInfo.ProductType != VER_NT_WORKSTATION.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions