oatpp / oatpp-openssl

OpenSSL adaptor for Oat++ applications
https://oatpp.io/
Apache License 2.0
13 stars 22 forks source link

Draft for reloadable configuration (Addressing oatpp/oatpp#483). #8

Closed bamkrs closed 2 years ago

bamkrs commented 2 years ago

DO NOT MERGE, UNTESTED PSEUDO-CODE-LIKE PROPOSAL


ssl_ctx_st are now bound to their respective Config via shared pointers. When creating an Connection, the config is passed and stored in the Connection, also in a shared pointer. Thus, we have full reference counting on the ssl_ctx_st. The context is automatically freed when no Connection exists with the config containing the context and the ConnectionProvider has loaded a new config.

Discussion: Since the context is now part of the config, shouldn't the code in instantiateTLSServer moved to Config? This way, SSLv23_server_method would be made easily configurable, too.

lganzzzo commented 2 years ago

Hey @bamkrs ,

There is no need doing this. All we have to do - is to add a setter method to network::Server that sets the connection provider.

If a new config should be loaded - we create new connection provider with new config, and set it to server.

bamkrs commented 2 years ago

Oh, yes. That's also a very valid approach :D I tried to make things more complicated then necessary.

But you have to build an entirely new connection provider and cant use the one from the components. I'm a little concerned that this will be somewhat confusing for some users.