MQTT and MQTTS with wolfSSL TSL library
Fork of MQTT by
MQTT is light weight publish/subscribe based messaging protocol for M2M, IoT. This library was forked from MQTT https://developer.mbed.org/teams/mqtt for adding MQTTS security layer on the protocol. TLS(SSL) part of the library is by wolfSSL.https://developer.mbed.org/users/wolfSSL/code/wolfSSL/
"connect" method was extended for TLS. Rest of API's stay compatible with MQTT.
connect methode
int connect(char* hostname, int port, const char *certName = NULL, int timeout=1000)
The 3rd argument certName can be following values.
- NULL: connecting with MQTT
- pointer to certificate file: connecting with MQTTS. PEM or DER for server verification.
- pointer to NULL string: connecting with MQTTS without server verification. This option is for prototyping only, not recommended in security perspective.
日本語:https://developer.mbed.org/users/wolfSSL/code/MQTTS/wiki/MQTTSライブラリ
MQTTEthernet.h@31:a51dd239b78e, 2014-05-22 (annotated)
- Committer:
- icraggs
- Date:
- Thu May 22 23:58:08 2014 +0000
- Revision:
- 31:a51dd239b78e
- Parent:
- 29:833386b16f3e
- Child:
- 41:b7e86fa6dbb8
Create MQTTSocket.h to not use EthernetInterface
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
icraggs | 29:833386b16f3e | 1 | |
icraggs | 29:833386b16f3e | 2 | #if !defined(MQTTETHERNET_H) |
icraggs | 29:833386b16f3e | 3 | #define MQTTETHERNET_H |
icraggs | 29:833386b16f3e | 4 | |
icraggs | 29:833386b16f3e | 5 | #include "MQTT_mbed.h" |
icraggs | 29:833386b16f3e | 6 | #include "EthernetInterface.h" |
icraggs | 31:a51dd239b78e | 7 | #include "MQTTSocket.h" |
icraggs | 29:833386b16f3e | 8 | |
icraggs | 31:a51dd239b78e | 9 | class MQTTEthernet : public MQTTSocket |
icraggs | 29:833386b16f3e | 10 | { |
icraggs | 29:833386b16f3e | 11 | public: |
icraggs | 29:833386b16f3e | 12 | MQTTEthernet() |
icraggs | 29:833386b16f3e | 13 | { |
icraggs | 29:833386b16f3e | 14 | eth.init(); // Use DHCP |
icraggs | 29:833386b16f3e | 15 | eth.connect(); |
icraggs | 29:833386b16f3e | 16 | } |
icraggs | 29:833386b16f3e | 17 | |
icraggs | 29:833386b16f3e | 18 | private: |
icraggs | 29:833386b16f3e | 19 | |
icraggs | 29:833386b16f3e | 20 | EthernetInterface eth; |
icraggs | 29:833386b16f3e | 21 | |
icraggs | 29:833386b16f3e | 22 | }; |
icraggs | 29:833386b16f3e | 23 | |
icraggs | 29:833386b16f3e | 24 | |
icraggs | 29:833386b16f3e | 25 | #endif |