-
Notifications
You must be signed in to change notification settings - Fork 72
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
Dropping hackney dependency #123
Comments
Is this going to become a problem with Root CA file expiring at the end of the month since we can't pass hackney options down? |
Should not be an issue, for two reasons:
|
Thanks @wojtekmach Option 2 sounds good, because it doesn't depend on any other packages.
This would replace the system call to Re: @voltone
Sorry, maybe I'm missing something. Isn't the purpose is to use If we use option 2, we could theoretically even use |
Yeah, that's the idea. But I'm not sure if it is possible, I hope it is. |
Right, but I interpreted the question as referring to the current situation, which relies on server certificate verification. I suppose @bryannaegele wanted to know whether current applications might stop fetching tzdata updates as a result of the DST Root CA expiry.
There is some value in using HTTPS even without the certificate verification. For one thing, the IANA repository might one day stop serving data over plain HTTP altogether. But yes, using HTTP would be possible.
It should be possible in theory, but |
RE RFC4880, got it, thanks Bram. In that case, I believe the next best thing is to use httpc with secure options and castore or certifi, I think many users will appreciate tzdata bringing just one extra dep. |
See also this that I just wrote about alerting about new versions and then requiring data updates via hex packages: #127 Comments appreciated. |
Yes. My only concern was if the CA expiry was going to prevent downloading. |
As you approach this issue, please also consider corporate environments in which TLS interception is active, as described in hexpm/hex#727. Something analogous to |
Also keep in mind that since OTP 25 there is support for native OS CA certificates that httpc can use and don't need the extra dependency |
We need Hackney to make sure that tzdata we're downloading and unpacking has not been tampered with. However, hackney brings many transient dependencies and for that reason I believe it is not the best choice, it would be great to depend on as least deps as possible.
I think we have two options:
Option 1: httpc +
castore
. EEF Security WG has a nice guide how to give httpc secure settings. I think this will be pretty simple to implement and already be a big improvement.Option 2: httpc + manually checking tzdata signature.
This would be similar to how
mix local.hex
works, it fetches https://repo.hex.pm/installs/hex-1.x.csv and https://repo.hex.pm/installs/hex-1.x.csv.signed and checks if it wasn't tampered with against Hex public key that is included in Elixir.Turns out tzdata releases are signed with GPG using Paul Eggert's public key. If we include the key in
tzdata
and verify against that, we wouldn't even needcastore
which I think would be a small win.I have a proof of concept:
the next step is to use
:public_key.verify/4
but not sure how to transform the arguments appropriately so it accepts them.Maybe @voltone could help with that :)
The text was updated successfully, but these errors were encountered: