Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface3 HTTPSClient TLS_axTLS mbed-rtos mbed
Diff: main.cpp
- Revision:
- 3:6d25972a1b21
- Parent:
- 2:e3807a060fa5
diff -r e3807a060fa5 -r 6d25972a1b21 main.cpp
--- a/main.cpp Thu Sep 05 14:29:02 2013 +0000
+++ b/main.cpp Thu Sep 12 09:06:57 2013 +0000
@@ -7,16 +7,16 @@
download them from this link:
http://mbed.org/media/uploads/feb11/certificates-twitter.zip
*/
-
+
#include "mbed.h"
#include "EthernetInterface.h"
#include "CertificateManager.h"
#include "HTTPSClient.h"
-
+
const char host[] = "twitter.com";
const char request[] = "https://twitter.com";
LocalFileSystem local("local");
-
+
int main()
{
set_time(1378370406);
@@ -28,7 +28,7 @@
printf("Error with EthernetInterface\n\r");
return -1;
}
-
+
/* Loading certificates in precomputed mode */
CertificateManager::add("/local/cert1.der");
CertificateManager::add("/local/cert2.der");
@@ -38,7 +38,7 @@
printf("Failed to load certificates\n");
return -1;
}
-
+
/* Now, let's connect to twitter.com */
HTTPSClient client;
if(!client.connect(host))
@@ -91,7 +91,7 @@
fwrite(buffer, 1, read, fp);
totalRead += read;
}
-
+
/* We're done, let's close everything */
fclose(fp);
printf("Disconnecting from %s\n", host);
@@ -99,4 +99,4 @@
eth.disconnect();
return 0;
-}
+}
\ No newline at end of file