certifi / erlang-certifi

SSL Certificates for Erlang
Other
131 stars 33 forks source link

Automatic updates at run time #32

Closed g-andrade closed 3 years ago

g-andrade commented 6 years ago

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:

Tricky bits:

To do (in case this goes ahead):

ericmj commented 6 years ago

I don't think it should do runtime updates by default.

g-andrade commented 6 years ago

👍 that's reasonable.

benoitc commented 6 years ago

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?

g-andrade commented 6 years ago

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.

benoitc commented 6 years ago

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.

benoitc commented 6 years ago

@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?

g-andrade commented 6 years ago

Oh, but wait. The way I did it, the module is recompiled and the ct_expand parse transform re-applied.

g-andrade commented 6 years ago

The ETS table is used only for more easily sourcing the CA bundle (either from priv dir or from memory.)

g-andrade commented 5 years ago

Any news?

benoitc commented 5 years ago

@g-andrade needs to revisit that patch but made a quick review last week:

  1. we should probably make the validation of the downloaded file stronger. I'm thinking to use a public key added during the server compilation.
  2. An idea to improve it was to put the result directly in the SSL cache. I'm not sure yet if it's possible, but that would reduce the memory usage

Otherwise I quite like the idea. This can be added for the next release next week IMO :)

benoitc commented 5 years ago

@g-andrade do you think you can make such changes? that would be helpul. I will take care of it anyway :)

g-andrade commented 5 years ago

I might find the time for it on the weekend, but no promises.

g-andrade commented 3 years ago

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.