-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMQTT_server_setting.h
102 lines (93 loc) · 5.02 KB
/
MQTT_server_setting.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef __MQTT_SERVER_SETTING_H__
#define __MQTT_SERVER_SETTING_H__
#define IOTHUB_AUTH_CLIENT_SIDE_CERT 1
#define IOTHUB_AUTH_SYMMETRIC_KEY 2
// Set your authentication method here
#define IOTHUB_AUTH_METHOD IOTHUB_AUTH_CLIENT_SIDE_CERT
#define DEVICE_ID "<< REPLACE WITH YOUR DEVICE ID >>"
#define MQTT_SERVER_HOST_NAME "<< REPLACE WITH YOUR HOST NAME >>"
#define MQTT_SERVER_PASSWORD "ignored" // If you're using symmetric key authentication, set this to an SAS Token
#define MQTT_SERVER_PORT 8883
/*
* Root CA certificate here in PEM format.
* "-----BEGIN CERTIFICATE-----\n"
* ...
* "-----END CERTIFICATE-----\n";
*/
// Obtained from https://os.mbed.com/users/AzureIoTClient/code/simplesample_mqtt/file/c48c89945a83/certs.c/
const char* SSL_CA_PEM =
/* Baltimore */
"-----BEGIN CERTIFICATE-----\r\n"
"MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ\r\n"
"RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD\r\n"
"VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX\r\n"
"DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9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M3LwIXBA2xo5sda1cnUWJo3Pq4uMgcL\r\n"
"e0t+fCut38NMkTl8F0arflspaqUVVUov\r\n"
"-----END CERTIFICATE-----\r\n";
#if IOTHUB_AUTH_METHOD == IOTHUB_AUTH_CLIENT_SIDE_CERT
/*
* (optional) Client certificate here in PEM format.
* Set NULL if you don't use.
* "-----BEGIN CERTIFICATE-----\n"
* ...
* "-----END CERTIFICATE-----\n";
*/
const char* SSL_CLIENT_CERT_PEM = "<< REPLACE WITH YOUR CERT >>";
/*
* (optional) Client private key here in PEM format.
* Set NULL if you don't use.
* "-----BEGIN RSA PRIVATE KEY-----\n"
* ...
* "-----END RSA PRIVATE KEY-----\n";
*/
const char* SSL_CLIENT_PRIVATE_KEY_PEM = "<< REPLACE WITH YOUR KEY >>";
#endif // IOTHUB_AUTH_METHOD == IOTHUB_AUTH_CLIENT_SIDE_CERT
#endif /* __MQTT_SERVER_SETTING_H__ */