Description
Describe Your Goal
I'm creating a wrapper around esp32_https_server to that has the same API as WebServer.h and WebServerSecure.h.
What Does Your Project Look Like
The WebServerSecure.h sequence of doing things is:
WebServer server();
server.getServer().setServerKeyAndCert(....);
server.begin();
HTTPSServer
uses a different paradigm, where the SSLCert
is passed in during construction.
I could of course delay the construction of the HTTPSServer
, but from inspection of the code it seems that the SSLCert
passed in during construction isn't actually used until start()
is called.
So, I could pass in an empty SSLCert
to the constructor, and then fill in the key/cert with SSLCert::setCert()
and SSLCert::setPK()
before calling HTTPSServer::start()
.
But it feels a bit like a hack to do this, so therefore my question: is it okay to depend on the ability to change the SSLCert between calling the HTTPSServer constructor and the start() method?