A simple client that allows the user to send Json data to Axeda's IoT cloud using an SSL socket (with certificate verification).
Dependencies: mbed
certs.h
00001 /** Any non-root certificates will have no effect on the SSL client, but will 00002 * use up extra space for their allocation into the certificate list. 00003 * Methods for obtaining the Root CA certificate(s) for a website: 00004 * 1. Open a browser to the target website using HTTPS. 00005 * (These instructions are for Chrome, but should be similar for other browsers) 00006 * Click on the lock icon at the beginning of the url, select the "connection" tab, 00007 * and click the "certificate information" hyperlink. The browser will open a new window 00008 * labeled "Certificate". Switch to the "Certification Path" tab, click the certificate 00009 * closest to the top of the window, then click "View Certificate". This will open a new 00010 * window labeled "Certificate" again. This time, click on the "Details" tab, then click 00011 * "Copy to File". This will open a "Certificate Export Wizard". Click next, and choose the 00012 * "Base-64 encoded X.509 (.CER)" option, then click next. Choose the name and location where 00013 * you want to save the PEM formatted certificate, then click next, then finish. Open the file 00014 * that was created and copy-paste the certificate into this certs.h file. Format the certificate 00015 * data so that each line begins with " and is appended with \r\n" 00016 * 00017 * 2. Go to https://www.bluessl.com/en/ssltest and enter the website for which you wish to get the root CA 00018 * certificates. Click the [Click here to download the public part of this certificate] button located 00019 * underneath the certificates that label themselves as Root, or Root CA. The root CA certificate should 00020 * self-signed, otherwise it is not the root CA certificate. Take the downloaded file, copy the data 00021 * into this certs.h file, and format the data so that each line begins with " and is appended with \r\n" 00022 * 00023 * 3. Using openssl on linux: (Make sure you have openssl installed.) Run the command: openssl s_client 00024 * -showcerts -connect <host>:<port> -CApath /etc/ssl/certs 00025 * Where <host> is the host name (www.google.com for example), and port is the port on which the connection 00026 * will be made (usually 443). When the connection is made with the remote server, the last certificate(s) 00027 * listed will be the Root CA certificate(s). Merely copy-paste those certificates into this certs.h file 00028 * and format them with each line beginning with " and ending with \r\n" 00029 */ 00030 00031 //Root Certificates 00032 const char CERTIFICATE1[1237] = 00033 00034 //Nucleus-connect.axeda.com 00035 //GeoTrustGlobalCA from GeoTrust website 00036 "-----BEGIN CERTIFICATE-----\r\n" 00037 "MIIDVD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CsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF\r\n" 00052 "PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un\r\n" 00053 "hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV\r\n" 00054 "5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==\r\n" 00055 "-----END CERTIFICATE-----\r\n"; 00056 const char CERTIFICATE2[849] = 00057 //VeriSignClass3PublicPrimaryCA 00058 "-----BEGIN CERTIFICATE-----\r\n" 00059 "MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG\r\n" 00060 "A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz\r\n" 00061 "cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2\r\n" 00062 "MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV\r\n" 00063 "BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt\r\n" 00064 "YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN\r\n" 00065 "ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE\r\n" 00066 "BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is\r\n" 00067 "I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G\r\n" 00068 "CSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i\r\n" 00069 "2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ\r\n" 00070 "2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ\r\n" 00071 "-----END CERTIFICATE-----\r\n"; 00072 const char CERTIFICATE3[977] = 00073 //Axeda Root CA Certificate 00074 "-----BEGIN CERTIFICATE-----\r\n" 00075 "MIICmTCCAgICAQAwDQYJKoZIhvcNAQEEBQAwgZQxCzAJBgNVBAYTAlVTMRYwFAYD\r\n" 00076 "VQQIEw1NYXNzYWNodXNldHRzMRIwEAYDVQQHEwlNYW5zZmllbGQxHDAaBgNVBAoT\r\n" 00077 "E0F4ZWRhIFN5c3RlbXMsIEluYy4xGTAXBgNVBAMTEEF4ZWRhIFN5c3RlbXMgQ0Ex\r\n" 00078 "IDAeBgkqhkiG9w0BCQEWEXN1cHBvcnRAYXhlZGEuY29tMB4XDTAzMDExMDE3MzUy\r\n" 00079 "N1oXDTEzMDEwNzE3MzUyN1owgZQxCzAJBgNVBAYTAlVTMRYwFAYDVQQIEw1NYXNz\r\n" 00080 "YWNodXNldHRzMRIwEAYDVQQHEwlNYW5zZmllbGQxHDAaBgNVBAoTE0F4ZWRhIFN5\r\n" 00081 "c3RlbXMsIEluYy4xGTAXBgNVBAMTEEF4ZWRhIFN5c3RlbXMgQ0ExIDAeBgkqhkiG\r\n" 00082 "9w0BCQEWEXN1cHBvcnRAYXhlZGEuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\r\n" 00083 "iQKBgQD0VtQ82SdSI4QTwIWIXTya91GJ4IFZMwY3eXVkg3jpBwGGQFAk2yOAhITZ\r\n" 00084 "nQkZn5/JEifRJTvLhqq7AtFqkKG0bKza3jLFhMDh4q7nn5en1wWvMWQM8hSA7cBV\r\n" 00085 "DYbtsRObM8b7TiC8ZlxhN/6fZFiLyzX431Ppx2nSjyfpHK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