Skip to content

Commit

Permalink
Merge pull request #19 from mindsphere/rc-4.4.0
Browse files Browse the repository at this point in the history
updated version to 4.4.0
  • Loading branch information
siemens-developer authored Sep 23, 2024
2 parents 21b15a5 + 0e57822 commit fc71862
Show file tree
Hide file tree
Showing 20 changed files with 596 additions and 88 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# [4.4.0] (2024-09-01)

## Update dependencies and certificates

* cJSON library version is upgraded to 1.7.18.
* Minimum required OpenSSL version is updated to 3.0.13 for users using OpenSSL as security library.
* Minimum required libCurl version is updated to 8.6.0 for users using libCurl as http client.
* QuoVadis Root CA 2 G3" certificate will be retired on 2024-10-15T04:00:00.000Z hence code examples are updated to use existing certificate as well as new certificate i.e. "DigiCert Global Root G2".

# [4.3.4] (2023-04-03)
## Certificate updates
* Insights Hub certificate update information publication

# [4.3.3] (2023-04-03)
## Documentation
* Documentation Changes.
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,19 @@ any components that it depends on.
- LibCurl is used as the default HTTP client in MCL but developers have the option to easily replace LibCurl with other HTTP client implementations.
Make sure LibCurl is installed on your system before building MCL if you are going to use LibCurl as the HTTP client.
Steps to build LibCurl for your target system are described in the following sections of this document.
Developers are encouraged to use newer versions of LibCurl but note that MCL is tested with LibCurl version 7.81.0.
Developers are encouraged to use newer versions of LibCurl but note that MCL is tested with LibCurl version 8.6.0.

Please make sure your HTTP client implementation is configured to use TLS v1.2 implementation.

- OpenSSL is used as the default TLS and cryptography library but developers have the option to easily replace OpenSSL with other implementations.
Make sure OpenSSL is installed on your system before building MCL if you are going to use OpenSSL as TLS and cryptography library.
Steps to build OpenSSL are described in the following sections of this document.
Developers are encouraged to use newer versions of OpenSSL 1.1.x but note that MCL is tested with OpenSSL version 1.1.1m.
Developers are encouraged to use newer versions of OpenSSL 3.0.x but note that MCL is tested with OpenSSL version 3.0.13.


> [!IMPORTANT]
> - Certificates in examples are for demo purpose only. Developers should always refer and use latest certificate published at [Insights Hub Documentation](https://documentation.mindsphere.io/MindSphere/resources/mindconnect-lib-v4/resources-mclib-cacert.html).
> - It is advised to use the system's Trusted Certificate Store or an external certificate file, rather than hardcoding the certificate, to simplify future certificate rotations. For Linux Systems Trusted Certificate Store location is /etc/ssl/certs, certificates present at this location will be referred while establishing connection. To understand more on Trusted Certificate Store, refer the [openssl documentation](https://docs.openssl.org/master/man7/ossl-guide-tls-introduction/#trusted-certificate-store).
One of following ciphers must be supported and configured for SSL handshaking:

Expand Down Expand Up @@ -257,25 +262,25 @@ Both the core component and the connectivity extension will be built. See **MCL
These are the steps of the build process in order:

### Building OpenSSL
Download OpenSSL package [openssl-1.1.1m.tar.gz](https://www.openssl.org/source/) and in your download directory run the following commands where
Download OpenSSL package [openssl-3.0.13.tar.gz](https://www.openssl.org/source/) and in your download directory run the following commands where
**\<OpenSSL_Install_Directory\>** refers to the directory you want to install OpenSSL:

```sh
$ tar -xvzf openssl-1.1.1m.tar.gz
$ cd openssl-1.1.1m
$ tar -xvzf openssl-3.0.13.tar.gz
$ cd openssl-3.0.13
$ ./config --prefix=<OpenSSL_Install_Directory> -Wl,-rpath=<OpenSSL_Install_Directory>/lib shared -fPIC
$ sudo make install
```

Now, there must be a folder named **openssl** in **\<OpenSSL_Install_Directory\>/include** and shared objects named **libcrypto.so** and **libssl.so** in **\<OpenSSL_Install_Directory\>/lib**.

### Building Libcurl
Download libcurl package [curl-7.81.0.tar.gz](https://curl.haxx.se/download/) and in your download directory run the following commands where
Download libcurl package [curl-8.6.0.tar.gz](https://curl.haxx.se/download/) and in your download directory run the following commands where
**\<libcurl_Install_Directory\>** refers to the directory you want to install libcurl:

```sh
$ tar -xvzf curl-7.81.0.tar.gz
$ cd curl-7.81.0
$ tar -xvzf curl-8.6.0.tar.gz
$ cd curl-8.6.0
$ LDFLAGS="-Wl,-R<OpenSSL_Install_Directory>/lib" ./configure --enable-http --with-ssl=<OpenSSL_Install_Directory> --prefix=<libcurl_Install_Directory> --without-libssh2 --disable-ftp --disable-tftp --disable-file --disable-ldap --disable-rtsp --disable-dict --disable-telnet --disable-pop3 --disable-imap --disable-smb --disable-scp --disable-sftp --disable-smtp --disable-gopher --disable-manual
$ sudo make install
```
Expand Down
247 changes: 247 additions & 0 deletions ReadMe_OSS.html

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions build_helper_cross_compile_for_rpi.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# This is deprecated. Use build_helper_linux.sh and modify accordingly.

#!/bin/bash
openssl_version=1.1.1m
curl_version=7.81.0
openssl_version=3.0.13
curl_version=8.6.0
main_directory=../mcl_sandbox_for_rpi
mcl_directory=$(pwd)

Expand All @@ -16,7 +18,7 @@ rpi_tool_path=$main_directory/raspberrypi_tools/arm-bcm2708/arm-linux-gnueabihf
wget -c https://www.openssl.org/source/openssl-$openssl_version.tar.gz
tar -xvzf openssl-$openssl_version.tar.gz

wget https://curl.haxx.se/download/curl-$curl_version.tar.gz
wget https://curl.se/download/curl-$curl_version.tar.gz
tar -xvzf curl-$curl_version.tar.gz

cd openssl-$openssl_version
Expand Down
10 changes: 5 additions & 5 deletions build_helper_linux.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
openssl_version=1.1.1m
curl_version=7.81.0
openssl_version=3.0.13
curl_version=8.6.0
main_directory=../mcl_sandbox
mcl_directory=$(pwd)

Expand All @@ -13,15 +13,15 @@ main_directory=$(pwd)
wget -c https://www.openssl.org/source/openssl-$openssl_version.tar.gz
tar -xvzf openssl-$openssl_version.tar.gz

wget https://curl.haxx.se/download/curl-$curl_version.tar.gz
wget https://curl.se/download/curl-$curl_version.tar.gz
tar -xvzf curl-$curl_version.tar.gz

cd openssl-$openssl_version
./config --prefix=$main_directory/install -Wl,-rpath=$main_directory/install/lib shared -fPIC && make install_sw
./config --prefix=$main_directory/install -Wl,-rpath=$main_directory/install/lib shared -fPIC --libdir=lib && make install_sw
cd ..

cd curl-$curl_version
LDFLAGS="-Wl,-R$main_directory/install/lib" ./configure --enable-http --with-ssl=$main_directory/install --prefix=$main_directory/install --without-libssh2 --disable-ftp --disable-tftp --disable-file --disable-ldap --disable-rtsp --disable-dict --disable-telnet --disable-pop3 --disable-imap --disable-smb --disable-scp --disable-sftp --disable-smtp --disable-gopher --disable-manual && make install
LDFLAGS="-Wl,-R$main_directory/install/lib" ./configure --enable-http --with-ssl=$main_directory/install --prefix=$main_directory/install --without-libssh2 --without-libpsl --disable-ftp --disable-tftp --disable-file --disable-ldap --disable-rtsp --disable-dict --disable-telnet --disable-pop3 --disable-imap --disable-smb --disable-scp --disable-sftp --disable-smtp --disable-gopher --disable-manual && make install
cd ..

mkdir mcl_build
Expand Down
6 changes: 3 additions & 3 deletions build_helper_win64.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set openssl_version=1.1.1m
set curl_version=7.81.0
set openssl_version=3.0.13
set curl_version=8.6.0
set path_to_7zip="C:\Program Files\7-Zip"
set path_to_visual_studio="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional"
set main_directory=..\mcl_sandbox
Expand All @@ -15,7 +15,7 @@ powershell -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.Secur
%path_to_7zip%\7z e openssl-%openssl_version%.tar.gz
%path_to_7zip%\7z x openssl-%openssl_version%.tar

powershell -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget http://curl.haxx.se/download/curl-%curl_version%.tar.gz -OutFile curl-%curl_version%.tar.gz}"
powershell -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget https://curl.se/download/curl-%curl_version%.tar.gz -OutFile curl-%curl_version%.tar.gz}"
%path_to_7zip%\7z e curl-%curl_version%.tar.gz
%path_to_7zip%\7z x curl-%curl_version%.tar

Expand Down
25 changes: 24 additions & 1 deletion mcl_connectivity/examples/create_mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,29 @@
#include "mcl_connectivity/mcl_connectivity.h"
#include "callbacks.h"

const char *mindsphere_certificate = "-----BEGIN CERTIFICATE-----\n"\
const char *mindsphere_certificate = "-----BEGIN CERTIFICATE-----\n"
"MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh\n"
"MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n"
"d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH\n"
"MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT\n"
"MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n"
"b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG\n"
"9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI\n"
"2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx\n"
"1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ\n"
"q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz\n"
"tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ\n"
"vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP\n"
"BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV\n"
"5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY\n"
"1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4\n"
"NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG\n"
"Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91\n"
"8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe\n"
"pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl\n"
"MrY=\n"
"-----END CERTIFICATE-----\n"
"-----BEGIN CERTIFICATE-----\n"\
"MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQEL\n"\
"BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n"\
"BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00\n"\
Expand Down Expand Up @@ -42,6 +64,7 @@ const char *mindsphere_certificate = "-----BEGIN CERTIFICATE-----\n"\
"WSr2Rz0ZiC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+M\n"\
"-----END CERTIFICATE-----";


#define DATA_POINT_COUNT 3

#define IS_AGENT_ALSO_ITS_DATA_OWNER 0
Expand Down
29 changes: 26 additions & 3 deletions mcl_connectivity/examples/dsc_upload.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,29 @@
#include "mcl_core/mcl_random.h"
#include "callbacks.h"

const char *mindsphere_certificate = "-----BEGIN CERTIFICATE-----\n"\
const char *mindsphere_certificate = "-----BEGIN CERTIFICATE-----\n"
"MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7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IOGZX1NG\n"
"Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91\n"
"8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe\n"
"pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl\n"
"MrY=\n"
"-----END CERTIFICATE-----\n"
"-----BEGIN CERTIFICATE-----\n"\
"MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQEL\n"\
"BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n"\
"BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00\n"\
Expand Down Expand Up @@ -45,6 +67,7 @@ const char *mindsphere_certificate = "-----BEGIN CERTIFICATE-----\n"\
"WSr2Rz0ZiC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+M\n"\
"-----END CERTIFICATE-----";


// Replace with your own initial access token.
const char *initial_access_token = "<Initial Access Token>";

Expand Down Expand Up @@ -126,7 +149,7 @@ int main(void)
// Core configuration and related parameters.
mcl_core_configuration_t *core_configuration = NULL;
mcl_uint16_t mindsphere_port = 443;
mcl_uint16_t proxy_port = 3128;
mcl_uint16_t proxy_port = 9400;
E_MCL_PROXY mcl_proxy = MCL_PROXY_HTTP;
E_MCL_SECURITY_PROFILE security_profile = MCL_SECURITY_SHARED_SECRET;

Expand Down Expand Up @@ -159,7 +182,7 @@ int main(void)
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_CERTIFICATE, mindsphere_certificate);
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_SECURITY_PROFILE, &security_profile);
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_USER_AGENT, "custom agent v1.0");
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_HOST, "192.168.0.1");
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_HOST, "194.138.0.5");
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_PORT, &proxy_port);
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_TYPE, &mcl_proxy);
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_IAT, initial_access_token);
Expand Down
32 changes: 28 additions & 4 deletions mcl_connectivity/examples/event_upload.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,29 @@

const char my_initial_access_token[] = "<Initial Access Token>";

const char mindsphere_certificate[] = "-----BEGIN CERTIFICATE-----\n"\
const char *mindsphere_certificate = "-----BEGIN CERTIFICATE-----\n"
"MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh\n"
"MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n"
"d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH\n"
"MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT\n"
"MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n"
"b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG\n"
"9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI\n"
"2/Ou8jqJkTx65qsGGmvPrC3o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"\
Expand Down Expand Up @@ -44,6 +66,8 @@ const char mindsphere_certificate[] = "-----BEGIN CERTIFICATE-----\n"\
"WSr2Rz0ZiC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+M\n"\
"-----END CERTIFICATE-----";



int main(void)
{
mcl_error_t code;
Expand All @@ -53,7 +77,7 @@ int main(void)
// Core configuration and related parameters.
mcl_core_configuration_t *core_configuration = NULL;
mcl_uint16_t mindsphere_port = 443;
mcl_uint16_t proxy_port = 3128;
mcl_uint16_t proxy_port = 9400;
E_MCL_PROXY mcl_proxy = MCL_PROXY_HTTP;
E_MCL_SECURITY_PROFILE security_profile = MCL_SECURITY_SHARED_SECRET;

Expand Down Expand Up @@ -81,10 +105,10 @@ int main(void)
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_MDSP_HOST, "https://southgate.eu1.mindsphere.io");
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_MDSP_PORT, &mindsphere_port);
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_CERTIFICATE, mindsphere_certificate);
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_HOST, "192.168.0.1");
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_HOST, "194.138.0.5");
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_PORT, &proxy_port);
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_PROXY_TYPE, &mcl_proxy);
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_USER_AGENT, "my user agent");
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_USER_AGENT, "custom agent v1.0");
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_TENANT, "mclibiot");
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_SECURITY_PROFILE, &security_profile);
mcl_core_configuration_set_parameter(core_configuration, MCL_CORE_CONFIGURATION_PARAMETER_CREDENTIALS_LOAD_CALLBACK, custom_load_function_shared_secret);
Expand Down
Loading

0 comments on commit fc71862

Please sign in to comment.