diff --git a/src/GraphQL.Client/Websocket/GraphQLHttpWebSocket.cs b/src/GraphQL.Client/Websocket/GraphQLHttpWebSocket.cs index 28b721eb..1afa6b98 100644 --- a/src/GraphQL.Client/Websocket/GraphQLHttpWebSocket.cs +++ b/src/GraphQL.Client/Websocket/GraphQLHttpWebSocket.cs @@ -399,7 +399,9 @@ public Task InitializeWebSocket() // the following properties are not supported in Blazor WebAssembly and throw a PlatformNotSupportedException error when accessed try { - _clientWebSocket.Options.ClientCertificates = ((HttpClientHandler)Options.HttpMessageHandler).ClientCertificates; + var certs = ((HttpClientHandler)Options.HttpMessageHandler).ClientCertificates; + if (certs != null) // ClientWebSocketOptions.ClientCertificates.set throws ArgumentNullException + _clientWebSocket.Options.ClientCertificates = certs; } catch (NotImplementedException) {