Datavenue Live Objects basic sample using liveobjects-iotsoftbox-mqtt library.
Dependencies: MQTTPacket
Revision 8:82317399e4ce, committed 2017-04-04
- Comitter:
- jhamel
- Date:
- Tue Apr 04 16:17:23 2017 +0200
- Parent:
- 7:4a00359262cb
- Commit message:
- Use CA from Symantec/VeriSign, and fix TLS issue
Changed in this revision
diff -r 4a00359262cb -r 82317399e4ce liveobjects_dev_params.h --- a/liveobjects_dev_params.h Tue Apr 04 14:38:50 2017 +0200 +++ b/liveobjects_dev_params.h Tue Apr 04 16:17:23 2017 +0200 @@ -19,8 +19,7 @@ // Set to 1 to enable TLS feature // (warning: check that LOC_SERV_PORT is the correct port in this case) -// WARNING: by defaut disable TLS, it does not work today with the liveobjects platform -#define SECURITY_ENABLED 0 +#define SECURITY_ENABLED 1 // Only used to overwrite the LiveOjects Server settings : // IP address, TCP port, Connection timeout in milliseconds. @@ -43,7 +42,7 @@ #endif // Here, set your LiveObject Apikey. It is mandatory to run the application -#define LOC_CLIENT_DEV_API_KEY "XXX" +#define LOC_CLIENT_DEV_API_KEY "XXXX" #if SECURITY_ENABLED
diff -r 4a00359262cb -r 82317399e4ce liveobjects_dev_params.h.txt --- a/liveobjects_dev_params.h.txt Tue Apr 04 14:38:50 2017 +0200 +++ b/liveobjects_dev_params.h.txt Tue Apr 04 16:17:23 2017 +0200 @@ -19,8 +19,7 @@ // Set to 1 to enable TLS feature // (warning: check that LOC_SERV_PORT is the correct port in this case) -// WARNING: by defaut disable TLS, it does not work today with the liveobjects platform -#define SECURITY_ENABLED 0 +#define SECURITY_ENABLED 1 // Only used to overwrite the LiveOjects Server settings : // IP address, TCP port, Connection timeout in milliseconds.
diff -r 4a00359262cb -r 82317399e4ce liveobjects_dev_security.h --- a/liveobjects_dev_security.h Tue Apr 04 14:38:50 2017 +0200 +++ b/liveobjects_dev_security.h Tue Apr 04 16:17:23 2017 +0200 @@ -19,30 +19,49 @@ #define VERIFY_MODE 0 -//#define SERVER_CERT NULL +//#define SERVER_CERT NULL #define CLIENT_CERT NULL #define CLIENT_PKEY NULL #define CLIENT_PKEY_PASSWORD 0 -#define SERVER_CERTIFICATE_COMMON_NAME "m2m.orange.com" +#ifdef SERVER_CERT + +#define SERVER_CERTIFICATE_COMMON_NAME NULL + +#else -#ifndef SERVER_CERT +#define SERVER_CERTIFICATE_COMMON_NAME "liveobjects.orange-business.com" +/* + * see https://knowledge.symantec.com/support/mpki-for-ssl-support/index?page=content&actp=CROSSLINK&id=SO5624 + */ const char SERVER_CERT[] = "-----BEGIN CERTIFICATE-----\n" - "MIICkzCCAfygAwIBAgIBFzANBgkqhkiG9w0BAQUFADBdMQswCQYDVQQGEwJGUjEN\n" - "MAsGA1UECAwETHlvbjEPMA0GA1UECgwGT3JhbmdlMQwwCgYDVQQLDANPQUIxIDAe\n" - "BgNVBAMMF0dyb3VwZSBPcmFuZ2UgSWFlcyBDQSAxMB4XDTE1MTEyMzA5MjAxMFoX\n" - "DTM1MTExODA5MjAxMFowXTELMAkGA1UEBhMCRlIxDTALBgNVBAgMBEx5b24xDzAN\n" - "BgNVBAoMBk9yYW5nZTEMMAoGA1UECwwDT0FCMSAwHgYDVQQDDBdHcm91cGUgT3Jh\n" - "bmdlIElhZXMgQ0EgMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAlsdFGeMj\n" - "4b4jS4JNscoplDWR9WaZX8lYHOjp0axIEQXTusOBvk22YofY5Tnv0x78S+wRuOH5\n" - "qgLPXClpshg8WtX2iwcvH0VxYfHIutZ1Whl4delpC5oiMs/Sa5h5VoBxEYu9EpCg\n" - "7EZc292xFoVFTQY/wUAgPKFbUdthDz9J/JECAwEAAaNjMGEwHQYDVR0OBBYEFFyA\n" - "eJlmSmyL24lhK5/fDoS6tdv5MB8GA1UdIwQYMBaAFFyAeJlmSmyL24lhK5/fDoS6\n" - "tdv5MBIGA1UdEwEB/wQIMAYBAf8CAQAwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEB\n" - "BQUAA4GBADvFP7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jxuf6/WhkcIz\n" + "SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG\n" + "BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+\n" + "rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/\n" + "NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E\n" + "BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH\n" + "BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy\n" + "aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv\n" + "MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE\n" + "p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y\n" + "5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK\n" + "WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ\n" + "4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N\n" + "hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq\n" "-----END CERTIFICATE-----\n"; #endif
diff -r 4a00359262cb -r 82317399e4ce main.cpp --- a/main.cpp Tue Apr 04 14:38:50 2017 +0200 +++ b/main.cpp Tue Apr 04 16:17:23 2017 +0200 @@ -22,7 +22,7 @@ #include "mbed.h" #include "rtos.h" -static const char* appv_version = "MBED SAMPLE V03.02"; +static const char* appv_version = "MBED SAMPLE V04.01"; #define MEASURES_ENABLED_AT_INIT 0 #define STREAM_PREFIX 1 @@ -1072,6 +1072,7 @@ output.printf("\n\r !!!! ERROR(%d) to start thread : thread_input_cons\r\n", ret); } +#if 1 output.printf(" ---- Start thread : thread_appli ....\r\n"); ret = appli_thread.start(thread_appli); if (ret) { @@ -1080,6 +1081,7 @@ wait_ms(1000); #endif +#endif // Enable the receipt of commands ret = LiveObjectsClient_ControlCommands(true);
diff -r 4a00359262cb -r 82317399e4ce mbedtls_configs/liveobjects_mbedtls_custom_config.h --- a/mbedtls_configs/liveobjects_mbedtls_custom_config.h Tue Apr 04 14:38:50 2017 +0200 +++ b/mbedtls_configs/liveobjects_mbedtls_custom_config.h Tue Apr 04 16:17:23 2017 +0200 @@ -124,7 +124,7 @@ #define MBEDTLS_BASE64_C // Reduce IO buffer to save RAM, default is 16KB -#define MBEDTLS_SSL_MAX_CONTENT_LEN 2048 +#define MBEDTLS_SSL_MAX_CONTENT_LEN (3*1024) // define to save 8KB RAM at the expense of ROM #undef MBEDTLS_AES_ROM_TABLES