Closed bamkrs closed 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.
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.
DO NOT MERGE, UNTESTED PSEUDO-CODE-LIKE PROPOSAL
ssl_ctx_st
are now bound to their respectiveConfig
via shared pointers. When creating anConnection
, the config is passed and stored in theConnection
, also in a shared pointer. Thus, we have full reference counting on thessl_ctx_st
. The context is automatically freed when noConnection
exists with the config containing the context and theConnectionProvider
has loaded a new config.Discussion: Since the context is now part of the config, shouldn't the code in
instantiateTLSServer
moved toConfig
? This way, SSLv23_server_method would be made easily configurable, too.