Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Client #78

Open
zinkett opened this issue Sep 28, 2022 · 0 comments
Open

Dynamic Client #78

zinkett opened this issue Sep 28, 2022 · 0 comments
Labels
question Further information is requested

Comments

@zinkett
Copy link

zinkett commented Sep 28, 2022

I would like to give the possibility to connect with Ethernet or WiFi or Modem (one of the three, decided during configuration..).
I have an ESP32.

At the moment I initialize all the Client at the same time:

std::unique_ptr<SSLClientParameters> mTLS;
SSLClient clientETH_secure(clientETH, TAs, (size_t)TAs_NUM, 35, 1, SSLClient::SSL_WARN);
SSLClient clientWIFI_secure(clientWIFI, TAs, (size_t)TAs_NUM, 35, 1, SSLClient::SSL_WARN);
SSLClient clientModem_secure(clientModem, TAs, (size_t)TAs_NUM, 35, 1, SSLClient::SSL_WARN);

and then in the setup() I decided only for one of them:

....
if(isModem){
  mTLS = std::unique_ptr<SSLClientParameters>(new SSLClientParameters(SSLClientParameters::fromPEM(my_CERT_CRT, sizeof my_CERT_CRT, my_CERT_PRIVATE, sizeof my_CERT_PRIVATE)));
  clientModem_secure.setMutualAuthParams(*mTLS);
  mqtt.setClient(clientModem_secure);
}

But using this way, I have some memory problem..
Is there an easier and better way?

Thank you!

@zinkett zinkett added the question Further information is requested label Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant