-
Notifications
You must be signed in to change notification settings - Fork 10.5k
System.Security.Cryptography fails on WASM #25285
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
Conversation
| _clientCertificates = new X509CertificateCollection(); | ||
| } | ||
| // System.Security.Cryptography isn't supported on WASM currently | ||
| catch { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catch PlatformNotSupportedException explicitly?
|
I approve the scenario for RC, pending other reviewers signing off, and CI passing. |
src/SignalR/clients/csharp/Http.Connections.Client/src/HttpConnectionOptions.cs
Show resolved
Hide resolved
| _clientCertificates = new X509CertificateCollection(); | ||
|
|
||
| // System.Security.Cryptography isn't supported on WASM currently | ||
| if (!Utils.IsRunningInBrowser()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you wanted to be extra nice, you could decorate the ClientCertificates property with [UnsupportedOSPlatform("browser")]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with that. Does it tell an analyzer that you shouldn't use that property? Will it complain at us using it internally for null checks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll warn if you use that property in a blazor application. Right now SignalR client doesn't claim to support browser so you wouldn't see the error internally. But it would print a warning in the null check once if you say the client targets browser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SignalR client doesn't claim to support browser
Is this something we should look into in 6.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like we have [SupportedOSPlatform("browser")] anywhere yet in this repo or in the runtime repo. I see [UnsupportedOSPlatform("browser")] in a couple places in both repos though.
Why would SignalR need to explicitly claim to support the "browser" platform? If it's opt-in, why put [UnsupportedOSPlatform("browser")] all over?
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
Ping reviewers |
Fixes #25259