Skip to content

Is it allowable to change an SSLCert between HTTPSServer construction and calling start()? #67

Open
@jackjansen

Description

@jackjansen

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions