alexrainman / ModernHttpClient

ModernHttpClient
MIT License
126 stars 28 forks source link

NotImplementedException when adding my client certificate #17

Closed TGlev closed 5 years ago

TGlev commented 5 years ago

Hello,

When I try to do this:

var handler = new NativeMessageHandler(
                throwOnCaptiveNetwork: false,
                customSSLVerification: true
            );
            handler.ClientCertificates.Add(certificate);

            var httpClient = new HttpClient(handler);

I get a NotImplementedException thrown on the handler.ClientCertificates.Add(certificate);

Is there any other way to add my certificate? The server I'm trying to communicate with requires me to send this certificate.

alexrainman commented 5 years ago

I am going to release another version of the plugin that implements two way certificate pinning.

alexrainman commented 5 years ago

ClientCertificates is not implemented in Mono System.Net.Http :(

TGlev commented 5 years ago

Too bad :(

Is there any way we can get around this?

TGlev commented 5 years ago

Is there a way with writing native code?

alexrainman commented 5 years ago

It is actually in native code but i have to change the plugin for that, which i already did but, i will release this week in a separated branch.

TGlev commented 5 years ago

That would be AWESOME!

alexrainman commented 5 years ago

Please, take a look at https://github.com/alexrainman/secure-modernhttpclient and let me know if that's what are you looking for.

TGlev commented 5 years ago

Yes, this is what Im looking for. Please publish the code or a dll. :D

alexrainman commented 5 years ago

Early this week.

TGlev commented 5 years ago

Awesome, thank you.

TGlev commented 5 years ago

The nuget link doesnt work. :(

alexrainman commented 5 years ago

Wait, not released yet. Will do between today and tomorrow.

TGlev commented 5 years ago

Awesome, thank you. :)

TGlev commented 5 years ago

Is there a problem you need help with?

alexrainman commented 5 years ago

I just released the secure-modernhttpclient branch.