Skip to content
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

macOS: Can HttpClient do custom cert handling with libcurl+openssl10? #21679

Closed
bartonjs opened this issue May 12, 2017 · 16 comments
Closed

macOS: Can HttpClient do custom cert handling with libcurl+openssl10? #21679

bartonjs opened this issue May 12, 2017 · 16 comments
Labels
area-System.Net.Http enhancement Product code improvement that does NOT require public API changes/additions os-mac-os-x macOS aka OSX
Milestone

Comments

@bartonjs
Copy link
Member

Gedankenexperiment:

  • If OpenSSL/1.0 is the reported backend, run the OpenSSL initializer.
  • Still fail client auth certificates (non-exportable private keys can't marshal into OpenSSL, and other problems could exist, so just block it)
  • If OpenSSL/1.0 is the reported backend, register the callbacks/etc as normal.
  • For the EE (server identity) cert and any presented intermediates, extract the certificate bytes to pass to new X509Certificate2(byte[]).
  • Build the X509Chain
  • Apply chain and hostname checks
  • Call the callback.
@bartonjs
Copy link
Member Author

cc @stephentoub

@karelz
Copy link
Member

karelz commented May 13, 2017

@bartonjs can you please set milestone? Or does it need discussion first?

@bartonjs
Copy link
Member Author

Since this will enable a workaround on macOS where none currently exists, this seems pretty worthwhile for 2.0. Of course, it's entirely experimental, so it's possible that it can't be done at a shipping quality in the time remaining.

@bartonjs bartonjs self-assigned this May 15, 2017
@joeyaiello
Copy link

Just wanted to 👍 this with the context that it would unblock PowerShell/PowerShell#3648 which would help a non-trivial amount of our customers and partners use PowerShell Core 6.0 on macOS. Feel free to ping me offline if you need more formal justification.

@stephentoub
Copy link
Member

@joeyaiello, just to be sure, https://github.com/dotnet/corefx/issues/19709 would also unblock PowerShell, right? It looks like SkipCertificateCheck just uses delegate { return true; }, so once #21672 is implemented, PowerShell could just assign this delegate instead of that one, and it wouldn't require the end user to work around it by changing out the libcurl being used. (To be clear, I would still like to see this issue implemented, as it addresses a larger set of problems albeit with a more complicated workaround on the user's part.)

@joeyaiello
Copy link

@stephentoub that sounds right to me, but I would need @daxian-dbw to confirm. Going to linkback to #21672 in that issue as well.

Thanks!

@karelz
Copy link
Member

karelz commented May 18, 2017

@bartonjs is the one you created workaround for? If not what else is left? Do you plan to finish it before vacation or should we give it to someone else?

@bartonjs
Copy link
Member Author

@karelz I haven't had a chance to start yet, honestly. If new problems would stop being discovered and distracting me, I'd probably be able to finish it. But it's looking iffy.

@stephentoub stephentoub self-assigned this May 19, 2017
@leecow
Copy link
Member

leecow commented May 23, 2017

Discussed in shiproom based on input from @stephentoub. Plan to work on for 2.1 and backport if it does turn out to be blocking.

@karelz
Copy link
Member

karelz commented May 23, 2017

@stephentoub did you mean to close it? Or leave it open for 2.1?

@karelz
Copy link
Member

karelz commented May 30, 2017

I think this was meant to track the 2.1 work ... reopening. @stephentoub please let me know if I misunderstood.

@karelz karelz reopened this May 30, 2017
@stephentoub stephentoub removed their assignment Jun 17, 2017
@tritao
Copy link
Contributor

tritao commented Jan 15, 2018

Any news when we can expect a fix for this one?

We're hitting this in really basic HTTP client code.

@karelz
Copy link
Member

karelz commented Jan 17, 2018

@bartonjs do you plan to work on it for 2.1?
cc @Priya91

@bartonjs
Copy link
Member Author

I was given to understand that this would be rendered moot by the managed HTTP handler. So I guess I thought this issue was closed. Though apparently it's assigned to me, and open 😄.

@karelz
Copy link
Member

karelz commented Jan 17, 2018

ManagedHandler will be just opt-in in 2.1. One day, it will be default.

Given the number of upvotes (22), I wonder if there is something targeted we could/should do for 2.1 -- given that we were even considering backporting it into servicing of 2.0 (https://github.com/dotnet/corefx/issues/19718#issuecomment-303532816).

@bartonjs bartonjs removed their assignment Jan 18, 2018
@karelz
Copy link
Member

karelz commented Mar 2, 2018

We discussed it with @bartonjs couple of weeks ago.
We came to conclusion there is nothing reasonable we can do here, except to wait for SocketsHttpHandler, which is coming in 2.1 (maybe even as default).

Anyone can give it a try with SocketsHttpHandler in 2.1 Preview1 - see blog post with details how to turn it on (heads up: the way how to turn it on will change in Preview2).

@karelz karelz closed this as completed Mar 2, 2018
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Http enhancement Product code improvement that does NOT require public API changes/additions os-mac-os-x macOS aka OSX
Projects
None yet
Development

No branches or pull requests

7 participants