Example program demonstrating use of HTTP or HTTPS protocol over a cellular connection with httpbin.org using the MTSAS library. (Demonstrates GET,POST,basic-auth)
certs.h
- Committer:
- Vanger
- Date:
- 2015-03-16
- Revision:
- 6:e5ea200c66c3
- Child:
- 7:c477f2ab9624
File content as of revision 6:e5ea200c66c3:
/** Any non-root certificates will have no effect on the SSL client, but will * use up extra space for their allocation into the certificate list. * Methods for obtaining the Root CA certificate(s) for a website: * 1. Open a browser to the target website using HTTPS. * (These instructions are for Chrome, but should be similar for other browsers) * Click on the lock icon at the beginning of the url, select the "connection" tab, * and click the "certificate information" hyperlink. The browser will open a new window * labeled "Certificate". Switch to the "Certification Path" tab, click the certificate * closest to the top of the window, then click "View Certificate". This will open a new * window labeled "Certificate" again. This time, click on the "Details" tab, then click * "Copy to File". This will open a "Certificate Export Wizard". Click next, and choose the * "Base-64 encoded X.509 (.CER)" option, then click next. Choose the name and location where * you want to save the PEM formatted certificate, then click next, then finish. Open the file * that was created and copy-paste the certificate into this certs.h file. Format the certificate * data so that each line begins with " and is appended with \r\n" * * 2. Go to https://www.bluessl.com/en/ssltest and enter the website for which you wish to get the root CA * certificates. Click the [Click here to download the public part of this certificate] button located * underneath the certificates that label themselves as Root, or Root CA. The root CA certificate should * self-signed, otherwise it is not the root CA certificate. Take the downloaded file, copy the data * into this certs.h file, and format the data so that each line begins with " and is appended with \r\n" * * 3. Using openssl on linux: (Make sure you have openssl installed.) Run the command: openssl s_client * -showcerts -connect <host>:<port> </dev/null * Where <host> is the host name (www.google.com for example), and port is the port on which the connection * will be made (usually 443). When the connection is made with the remote server, the last certificate(s) * listed will be the Root CA certificate(s). Merely copy-paste those certificates into this certs.h file * and format them with each line beginning with " and ending with \r\n" * */ //Root Certificates char CERTIFICATES[1547] = //Root certificate Authority for Httpbin.org "-----BEGIN CERTIFICATE-----\r\n" "MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU\r\n" "MBIGA1UEChMLQWRkVH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