-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Unable to add a Certificate in ClientCertificates from HttpClientHandler/SocketsHttpHandler #78933
Comments
@jonathanpeppers Thoughts? |
Transfer to dotnet/runtime? |
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/ncl Issue DetailsDescriptionHello,
Its throw on the shh.SslOptions.ClientCertificates.Add(cert); The certificate itself has a sha256 algoritm with its public key as RSA 2048 Bits I also tried to use the network_security_config.xml from android and it crashed when i put the CA and pin Steps to Reproduce
Link to public reproduction project repositoryhttps://github.com/taz4270/ExampleCert.App Version with bug7.0 (current) Last version that worked wellUnknown/Other Affected platformsiOS, Android Affected platform versionsAndroid 13, iOS 16 Did you find any workaround?No response Relevant log outputNo response
|
Tagging subscribers to 'arch-android': @steveisok, @akoeplinger Issue DetailsDescriptionHello,
Its throw on the shh.SslOptions.ClientCertificates.Add(cert); The certificate itself has a sha256 algoritm with its public key as RSA 2048 Bits I also tried to use the network_security_config.xml from android and it crashed when i put the CA and pin Steps to Reproduce
Link to public reproduction project repositoryhttps://github.com/taz4270/ExampleCert.App Version with bug7.0 (current) Last version that worked wellUnknown/Other Affected platformsiOS, Android Affected platform versionsAndroid 13, iOS 16 Did you find any workaround?No response Relevant log outputNo response
|
any additional thoughts @simonrozsival |
Indeed, but only on SocketsHttpHandler because if you are using HttpClientHandler I already initialized |
@taz4270 You're right. Unfortunately, the native handler currently doesn't implement |
I'm wondering if we should throw |
I agree with you, but i would go further, making the message to reference a guide "how to use" for android, something like that, or even deprecate only for android with the same message of the guide. |
@simonrozsival would it be possible to triage this issue? |
Triage: unless we implement dotnet/android#7274 in time for .NET 8, we should change the exception to PNSE. We should do the same in the iOS implementation to make sure these two platforms behave the same way (https://github.com/xamarin/xamarin-macios/blob/d3af5724f25b58bf0c1134e5c5f736a0866bbcfd/src/Foundation/NSUrlSessionHandler.cs#L573). |
throwing better exception would be good IMHO @simonrozsival. We can improve the functional if we find the time. It may by worth of documentation for 6&7.... |
@taz4270 could you share the code how did you add the credentials to the Socket? Thanks. |
What happened to the fix for this issue? |
Is this still an issue? I'm using client certificates for PKI authentication in both iOS and Android using the SocketsHttpHandler. Just note it only currently works with X509Certificates that have full access to the private key so they rather limited since you can't use the installed certificates. |
Description
Hello,
When I try to add a credential in ClientCredentials, its throws a NullReferenceException although, the code i wrote is quite simple
Its throw on the shh.SslOptions.ClientCertificates.Add(cert);
The certificate itself has a sha256 algoritm with its public key as RSA 2048 Bits
I also tried to use the network_security_config.xml from android and it crashed when i put the CA and pin
Steps to Reproduce
Link to public reproduction project repository
https://github.com/taz4270/ExampleCert.App
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
Android 13, iOS 16
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: