Skip to content

Commit

Permalink
Fix ArgumentNullException from ClientWebSocketOptions.ClientCertifica…
Browse files Browse the repository at this point in the history
…tes (#431)
  • Loading branch information
sungam3r authored Aug 1, 2022
1 parent b4c6c82 commit 8379f8f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/GraphQL.Client/Websocket/GraphQLHttpWebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 8379f8f

Please sign in to comment.