Skip to content

Commit e4b2e5d

Browse files
committed
proto:mqtt:add api to configure SSL client cert and key
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent f575b2c commit e4b2e5d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

include/proto/mqttclient.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
extern "C" {
2020
#endif
2121

22-
#define MQTT_TOPIC_LEN_MAX 64
22+
#define MQTT_TOPIC_LEN_MAX 256
2323

2424
/**
2525
* @brief MQTT error codes
@@ -168,6 +168,24 @@ const char *mqtt_set_port(mqtt_client_t *client, const char *port);
168168
*/
169169
const char *mqtt_set_ca(mqtt_client_t *client, const char *ca);
170170

171+
/**
172+
* @brief Set client certificate
173+
*
174+
* @param client MQTT client handle
175+
* @param cert client certificate in PEM format
176+
* @return 0 on success, error code otherwise
177+
*/
178+
int mqtt_set_client_cert(mqtt_client_t *client, char* cert);
179+
180+
/**
181+
* @brief Set client private key
182+
*
183+
* @param client MQTT client handle
184+
* @param key client private key
185+
* @return 0 on success, error code otherwise
186+
*/
187+
int mqtt_set_client_prvkey(mqtt_client_t *client, char* key);
188+
171189
/**
172190
* @brief Set custom user argument passed to reconnect hook handler
173191
*

0 commit comments

Comments
 (0)