WiFiManager + Custom Param + WiFiClientSecure

Hello fellow arduinians.
I'm battling a bit of a challenge that I do not have the intelligence to figure out on my own, so I'm reaching out here to see if anyone implemented something similar before.

Problem Statement:
I would like to use WiFiManager with a few custom parameters. For arguments sake, we can claim those to be an MQTT Server, and a certificate for authentication on 8883.
In other words, I would like to create a firmware generic enough so that i do not have to hardcode a certificate for authentication, but add it manually in the wifi setup as a string.

Progress thus far
It works just fine if I include the certificate in the code, either like so:

const char* CERT_TEST = \
"-----BEGIN CERTIFICATE-----\n" \
"MANYLINESOFCERTCHARS\n" \
"MANYLINESOFCERTCHARS\n" \
"-----END CERTIFICATE-----\n"; 

or, if I add it like so:

static const char CERT_TEST[] PROGMEM = R"KEY(
-----BEGIN CERTIFICATE-----
MANYLINESOFCERTCHARS
MANYLINESOFCERTCHARS
-----END CERTIFICATE-----
)KEY";

But how ever I try to pass the same data from a WiFiManager custom parameter, formatting seems to get Fked up and the following error is thrown upon connection:
wifimanager X509 - Format not recognized as DER or PEM

Does anyone have any insights to how I could get the following to work?
Thanks a mill,
// NoCoder

Hi,
what controller are you using?
The library website has a lot of information about it.
Using the proper tags, </>, post the code you used and it doesn't work.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.