Closed g-andrade closed 3 years ago
I don't think it should do runtime updates by default.
👍 that's reasonable.
I will have a closer look on the source code but at a first glance, why not building dynamically the module at runtime and switch the version instead of introducing a new layer?
why not building dynamically the module at runtime and switch the version instead of introducing a new layer?
You mean doing a new build of an updated version of certifi
and then deploying that as a hot code reload?
If that's it, it would work, but still require manual intervention. What I seek is something that can update itself so that systems can be left running for months / years without risking sudden failure because some important external service based on SSL starts serving a certificate that's signed by a new CA that certifi
doesn't know about.
mm no I was thinking compile the beam and replace it directly in memory using merl for example, there is no real need to redeploy in such a case.
@g-andrade just pushing the idea anyway. I'm fine with ETS but using a beam should make it more efficient for something called that often. Thoughts?
Oh, but wait. The way I did it, the module is recompiled and the ct_expand
parse transform re-applied.
The ETS table is used only for more easily sourcing the CA bundle (either from priv dir or from memory.)
Any news?
@g-andrade needs to revisit that patch but made a quick review last week:
Otherwise I quite like the idea. This can be added for the next release next week IMO :)
@g-andrade do you think you can make such changes? that would be helpul. I will take care of it anyway :)
I might find the time for it on the weekend, but no promises.
I might find the time for it on the weekend, but no promises.
Well, it looks like I didn't.
Closing this - I don't think I'll ever resume work on it. But I'll keep the branch around, in case someone wishes to pick it up.
This is only a proof of concept for now, as I would like to get some input on whether this is actually feasible.
Main points:
certifi
module will then be recompiled so that it loads and exposes the new bundle while still enjoying the performance benefits brought out by thect_expand
parse transform.Tricky bits:
ssl_verify_fun
must be imported as a dependency and the usual CA verification boilerplate enforced;certifi
tries to update using a HTTPS URL whose certificate was signed by a CA still not listed on the bundled list, and therefore be put in a chicken-and-egg sort of situation;To do (in case this goes ahead):