Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] How to dynamically assign value to ssl.trustStore

Hi,

I am using paho C library. I want to connect to SSL enabled broker.

I initialize MQTTClient_connectOptions and MQTTClient_SSLOptions with required values.
I am able to connect to the broker with my settings.

One issue I have is, currently I have directly assigned ssl.trustStore value in the code. Like,
ssl.trustStore = "ssl://<IP Address>:<Port>"

I would like to read the server IP from configuration file.
How can I assign the value read from configuration file to ssl.trustStore?

This variable is defined as "const char* trustStore" in MQTTClient_SSLOptions.
Hence I cannot use strcpy() or other c functions. Any idea how to dynamically assign value to trustStore?

Thanks

Back to the top