You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PortingGuide.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,12 @@
4
4
The scope of this document is to provide instructions to modify the provided source files and functions in of this SDK to run in a variety of embedded C–based environments (e.g. real-time OS, embedded Linux) and to be adjusted to use a specific TLS implementation as available with specific hardware platforms.
5
5
6
6
##Contents of the SDK
7
-
The SDK ported for linux could be downloaded from this link The C-code files of this SDK are delivered via the following directory structure (see comment behind folder name for an explanation of its content).
7
+
8
+
The SDK ported for linux can be downloaded from the below links.
*[mbedTLS from ARM](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_mbedtls-1.0.1.tar)
11
+
12
+
The C-code files of this SDK are delivered via the following directory structure (see comment behind folder name for an explanation of its content).
8
13
9
14
Directory structure Current SDK Directory Layout (OpenSSL)
10
15
@@ -30,7 +35,7 @@ All makefiles in this SDK were configured using the documented folder structure
30
35
31
36
`aws_mqtt_embedded_client_lib` : The source code for the Embedded C MQTT client. This client is a modified version of the [Eclipse Paho](http://www.eclipse.org/paho/clients/c/embedded/) Embedded C client. The modifications include improved keep alive handling (callback on disconnect), a fix for unsubscribe functionality, buffer protection against too large MQTT messages and additional callback context to allow for a better layered architecture of the AWS IoT SDK.
32
37
33
-
`certs` : This directory is initially empty and will need to contain the private key, the client certificate and the root CA. The client certificate and private key can be downloaded from the AWS IoT console or be created using the AWS CLI commands. The root CA can be downloaded from here.
38
+
`certs` : This directory is initially empty and will need to contain the private key, the client certificate and the root CA. The client certificate and private key can be downloaded from the AWS IoT console or be created using the AWS CLI commands. The root CA can be downloaded from [Symantec](https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem).
34
39
35
40
`docs` : SDK API and file documentation.
36
41
@@ -66,9 +71,9 @@ left_ms - query time in milliseconds left on the timer.
66
71
67
72
###Network Functions
68
73
69
-
In order to for the MQTT client stack to be able to communicate via the TCP/IP network protocol stack using a mutually authenticated TLS connection, the following API calls need to be implemented for your platform.
74
+
In order for the MQTT client stack to be able to communicate via the TCP/IP network protocol stack using a mutually authenticated TLS connection, the following API calls need to be implemented for your platform.
70
75
71
-
For additional details about API parameters refer to the API documentation.
76
+
For additional details about API parameters refer to the [API documentation](http://aws-iot-device-sdk-embedded-c-docs.s3-website-us-east-1.amazonaws.com/index.html).
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,8 +29,8 @@ Ensure you understand the AWS IoT platform and create the necessary certificates
29
29
30
30
In order to quickly get started with the AWS IoT platform, we have ported the SDK for POSIX type Operating Systems like Ubuntu, OS X and RHEL. The porting of the SDK happens at the TLS layer, and for the MQTT protocol. The SDK is configured for two TLS libraries and can be built out of the box with *GCC* using *make utility*. The tarballs can be downloaded from the below links.
*[mbedTLS from ARM](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_mbedtls-1.0.1.tar)
34
34
35
35
##Installation
36
36
This section explains the individual steps to retrieve the necessary files and be able to build your first application using the AWS IoT device SDK for embedded C.
@@ -53,7 +53,7 @@ Steps:
53
53
* Explore the example. It connects to AWS IoT platform using MQTT and demonstrates few actions that can be performed by the SDK
54
54
* Build the example using make. (''make'')
55
55
* Place device identity cert and private key in locations referenced in the example (certs/). Alternatively, you can run the sample application with the ''-c'' flag to point to a specific certificate directory.
56
-
* Download certificate authority CA file from this [link](https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem) and place in location referenced in the example (certs/). Ensure the names of the cert files are the same as in the `aws_iot_config.h` file
56
+
* Download certificate authority CA file from [Symantec](https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem) and place in location referenced in the example (certs/). Ensure the names of the cert files are the same as in the `aws_iot_config.h` file
57
57
* Run sample application (./subscribe_publish_sample or ./shadow_sample). The sample will print status messages to stdout.
58
58
* More information on the examples could be found in the sample source file
Copy file name to clipboardExpand all lines: aws_iot_src/protocol/mqtt/aws_iot_embedded_client_wrapper/platform_linux/openssl/network_openssl_wrapper.c
+19-1Lines changed: 19 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,15 @@
20
20
#include<openssl/x509_vfy.h>
21
21
#include<sys/socket.h>
22
22
#include<fcntl.h>
23
+
#include<errno.h>
24
+
#include<string.h>
23
25
#include<sys/select.h>
24
26
#include<arpa/inet.h>
25
27
#include<netinet/in.h>
26
28
#include<netdb.h>
27
29
28
30
#include"aws_iot_error.h"
31
+
#include"aws_iot_log.h"
29
32
#include"network_interface.h"
30
33
#include"openssl_hostname_validation.h"
31
34
@@ -57,6 +60,7 @@ int iot_tls_init(Network *pNetwork) {
57
60
method=TLSv1_2_method();
58
61
59
62
if ((pSSLContext=SSL_CTX_new(method)) ==NULL) {
63
+
ERROR(" SSL INIT Failed - Unable to create SSL Context");
60
64
ret_val=SSL_INIT_ERROR;
61
65
}
62
66
@@ -103,14 +107,17 @@ int iot_tls_connect(Network *pNetwork, TLSConnectParams params) {
103
107
}
104
108
105
109
if (!SSL_CTX_load_verify_locations(pSSLContext, params.pRootCALocation, NULL)) {
110
+
ERROR(" Root CA Loading error");
106
111
ret_val=SSL_CERT_ERROR;
107
112
}
108
113
109
114
if (!SSL_CTX_use_certificate_file(pSSLContext, params.pDeviceCertLocation, SSL_FILETYPE_PEM)) {
0 commit comments