blob: 8880aec1532734d8c8ff8376b85fdf17a09b9eaf [file] [log] [blame]
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +02001/*
2 * Hello world example of a TLS client: fetch an HTTPS page
3 *
4 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
5 *
6 * This file is part of mbed TLS (https://tls.mbed.org)
Manuel Pégourié-Gonnardcdee2d92015-08-07 09:40:51 +02007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020021 */
22
23#if !defined(TARGET_LIKE_MBED)
24
25#include <stdio.h>
26
27int main() {
28 printf("this program only works on mbed OS\n");
29 return 0;
30}
31
32#else
33
34/** \file main.cpp
35 * \brief An example TLS Client application
36 * This application sends an HTTPS request to developer.mbed.org and searches for a string in
37 * the result.
38 *
39 * This example is implemented as a logic class (HelloHTTPS) wrapping a TCP socket.
40 * The logic class handles all events, leaving the main loop to just check if the process
41 * has finished.
42 */
43
44/* Change to a number between 1 and 4 to debug the TLS connection */
45#define DEBUG_LEVEL 0
46
47/* Change to 1 to skip certificate verification (UNSAFE, for debug only!) */
48#define UNSAFE 0
49
50#include "mbed.h"
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +020051#include "mbed-net-lwip-eth/EthernetInterface.h"
52#include "mbed-net-sockets/TCPStream.h"
53#include "minar/minar.h"
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +020054
55#include "mbedtls/ssl.h"
56#include "mbedtls/entropy.h"
57#include "mbedtls/ctr_drbg.h"
58#include "mbedtls/error.h"
59#if DEBUG_LEVEL > 0
60#include "mbedtls/debug.h"
61#endif
62
63#include "lwipv4_init.h"
64
65namespace {
66const char *HTTPS_SERVER_NAME = "developer.mbed.org";
67const int HTTPS_SERVER_PORT = 443;
68const int RECV_BUFFER_SIZE = 600;
69
70const char HTTPS_PATH[] = "/media/uploads/mbed_official/hello.txt";
71const size_t HTTPS_PATH_LEN = sizeof(HTTPS_PATH) - 1;
72
73/* Test related data */
74const char *HTTPS_OK_STR = "200 OK";
75const char *HTTPS_HELLO_STR = "Hello world!";
76
77/* personalization string for the drbg */
78const char *DRBG_PERS = "mbed TLS helloword client";
79
80/* List of trusted root CA certificates
81 * currently just Verisign since it's the root used by developer.mbed.org
82 * If you want to trust more that one root, just concatenate them.
83 */
84const char SSL_CA_PEM[] =
85"-----BEGIN CERTIFICATE-----\n"
86"MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG\n"
87"A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv\n"
88"b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw\n"
89"MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i\n"
90"YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT\n"
91"aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ\n"
92"jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp\n"
93"xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp\n"
94"1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG\n"
95"snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ\n"
96"U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8\n"
97"9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E\n"
98"BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B\n"
99"AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz\n"
100"yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE\n"
101"38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP\n"
102"AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad\n"
103"DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME\n"
104"HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n"
105"-----END CERTIFICATE-----\n";
106}
107
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200108using namespace mbed::Sockets::v0;
109
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200110/**
111 * \brief HelloHTTPS implements the logic for fetching a file from a webserver
112 * using a TCP socket and parsing the result.
113 */
114class HelloHTTPS {
115public:
116 /**
117 * HelloHTTPS Constructor
118 * Initializes the TCP socket, sets up event handlers and flags.
119 *
120 * Note that CThunk is used for event handlers. This will be changed to a C++
121 * function pointer in an upcoming release.
122 *
123 *
124 * @param[in] domain The domain name to fetch from
125 * @param[in] port The port of the HTTPS server
126 */
127 HelloHTTPS(const char * domain, const uint16_t port) :
128 _stream(SOCKET_STACK_LWIP_IPV4), _domain(domain), _port(port)
129 {
130
131 _error = false;
132 _gothello = false;
133 _got200 = false;
134 _bpos = 0;
135 _request_sent = 0;
136 _stream.open(SOCKET_AF_INET4);
137
138 mbedtls_entropy_init(&_entropy);
139 mbedtls_ctr_drbg_init(&_ctr_drbg);
140 mbedtls_x509_crt_init(&_cacert);
141 mbedtls_ssl_init(&_ssl);
142 mbedtls_ssl_config_init(&_ssl_conf);
143 }
144 /**
145 * Initiate the test.
146 *
147 * Starts by clearing test flags, then resolves the address with DNS.
148 *
149 * @param[in] path The path of the file to fetch from the HTTPS server
150 * @return SOCKET_ERROR_NONE on success, or an error code on failure
151 */
152 socket_error_t startTest(const char *path) {
153 /* Initialize the flags */
154 _got200 = false;
155 _gothello = false;
156 _error = false;
157 _disconnected = false;
158 _request_sent = false;
159 /* Fill the request buffer */
160 _bpos = snprintf(_buffer, sizeof(_buffer) - 1, "GET %s HTTP/1.1\nHost: %s\n\n", path, HTTPS_SERVER_NAME);
161
162 /*
163 * Initialize TLS-related stuf.
164 */
165 int ret;
166 if ((ret = mbedtls_ctr_drbg_seed(&_ctr_drbg, mbedtls_entropy_func, &_entropy,
167 (const unsigned char *) DRBG_PERS,
168 sizeof (DRBG_PERS))) != 0) {
169 print_mbedtls_error("mbedtls_crt_drbg_init", ret);
170 return SOCKET_ERROR_UNKNOWN;
171 }
172
173 if ((ret = mbedtls_x509_crt_parse(&_cacert, (const unsigned char *) SSL_CA_PEM,
174 sizeof (SSL_CA_PEM))) != 0) {
175 print_mbedtls_error("mbedtls_x509_crt_parse", ret);
176 return SOCKET_ERROR_UNKNOWN;
177 }
178
179 if ((ret = mbedtls_ssl_config_defaults(&_ssl_conf,
180 MBEDTLS_SSL_IS_CLIENT,
181 MBEDTLS_SSL_TRANSPORT_STREAM,
182 MBEDTLS_SSL_PRESET_DEFAULT)) != 0) {
183 print_mbedtls_error("mbedtls_ssl_config_defaults", ret);
184 return SOCKET_ERROR_UNKNOWN;
185 }
186
187 mbedtls_ssl_conf_ca_chain(&_ssl_conf, &_cacert, NULL);
188 mbedtls_ssl_conf_rng(&_ssl_conf, mbedtls_ctr_drbg_random, &_ctr_drbg);
189
190#if UNSAFE
191 mbedtls_ssl_conf_authmode(&_ssl_conf, MBEDTLS_SSL_VERIFY_OPTIONAL);
192#endif
193
194#if DEBUG_LEVEL > 0
195 mbedtls_ssl_conf_verify(&_ssl_conf, my_verify, NULL);
196 mbedtls_ssl_conf_dbg(&_ssl_conf, my_debug, NULL);
197 mbedtls_debug_set_threshold(DEBUG_LEVEL);
198#endif
199
200 if ((ret = mbedtls_ssl_setup(&_ssl, &_ssl_conf)) != 0) {
201 print_mbedtls_error("mbedtls_ssl_setup", ret);
202 return SOCKET_ERROR_UNKNOWN;
203 }
204
205 mbedtls_ssl_set_hostname(&_ssl, HTTPS_SERVER_NAME);
206
207 mbedtls_ssl_set_bio(&_ssl, static_cast<void *>(&_stream),
208 ssl_send, ssl_recv, NULL );
209
210
211 /* Connect to the server */
212 printf("Connecting to %s:%d\r\n", _domain, _port);
213 /* Resolve the domain name: */
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200214 socket_error_t err = _stream.resolve(_domain, TCPStream::DNSHandler_t(this, &HelloHTTPS::onDNS));
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200215 return err;
216 }
217 /**
218 * Check if the test has completed.
219 * @return Returns true if done, false otherwise.
220 */
221 bool done() {
222 return _error || (_got200 && _gothello);
223 }
224 /**
225 * Check if there was an error
226 * @return Returns true if there was an error, false otherwise.
227 */
228 bool error() {
229 return _error;
230 }
231 /**
232 * Closes the TCP socket
233 */
234 void close() {
235 _stream.close();
236 while (!_disconnected)
237 __WFI();
238 }
239protected:
240 /**
241 * Helper for pretty-printing mbed TLS error codes
242 */
243 static void print_mbedtls_error(const char *name, int err) {
244 char buf[128];
245 mbedtls_strerror(err, buf, sizeof (buf));
246 printf("%s() failed: -0x%04x (%d): %s\r\n", name, -err, err, buf);
247 }
248
249#if DEBUG_LEVEL > 0
250 /**
251 * Debug callback for mbed TLS
252 * Just prints on the USB serial port
253 */
254 static void my_debug(void *ctx, int level, const char *str)
255 {
256 (void) ctx;
257 (void) level;
258
259 printf("%s", str);
260 }
261
262 /**
263 * Certificate verification callback for mbed TLS
264 * Here we only use it to display information on each cert in the chain
265 */
266 static int my_verify(void *data, mbedtls_x509_crt *crt, int depth, int *flags)
267 {
268 char buf[1024];
269 (void) data;
270
271 printf("\nVerifying certificate at depth %d:\n", depth);
272 mbedtls_x509_crt_info(buf, sizeof (buf) - 1, " ", crt);
273 printf("%s", buf);
274
275 if (*flags == 0)
276 printf("No verification issue for this certificate\n");
277 else
278 {
279 mbedtls_x509_crt_verify_info(buf, sizeof (buf), " ! ", *flags);
280 printf("%s\n", buf);
281 }
282
283 return 0;
284 }
285#endif
286
287 /**
288 * Receive callback for mbed TLS
289 */
290 static int ssl_recv(void *ctx, unsigned char *buf, size_t len) {
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200291 TCPStream *stream = static_cast<TCPStream *>(ctx);
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200292 socket_error_t err = stream->recv(buf, &len);
293
294 if (err == SOCKET_ERROR_NONE) {
295 return static_cast<int>(len);
296 } else if (err == SOCKET_ERROR_WOULD_BLOCK) {
297 return MBEDTLS_ERR_SSL_WANT_READ;
298 } else {
299 return -1;
300 }
301 }
302
303 /**
304 * Send callback for mbed TLS
305 */
306 static int ssl_send(void *ctx, const unsigned char *buf, size_t len) {
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200307 TCPStream *stream = static_cast<TCPStream *>(ctx);
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200308
309 socket_error_t err = stream->send(buf, len);
310
311 if (err == SOCKET_ERROR_NONE) {
312 return static_cast<int>(len);
313 } else if (err == SOCKET_ERROR_WOULD_BLOCK) {
314 return MBEDTLS_ERR_SSL_WANT_WRITE;
315 } else {
316 return -1;
317 }
318 }
319
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200320 void onError(Socket *s, socket_error_t err) {
321 (void) s;
322 printf("MBED: Socket Error: %s (%d)\r\n", socket_strerror(err), err);
323 _stream.close();
324 _error = true;
325 minar::Scheduler::stop();
326 }
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200327 /**
328 * On Connect handler
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200329 * Starts the TLS handshake
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200330 */
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200331 void onConnect(TCPStream *s) {
332 s->setOnReadable(TCPStream::ReadableHandler_t(this, &HelloHTTPS::onReceive));
333 s->setOnDisconnect(TCPStream::DisconnectHandler_t(this, &HelloHTTPS::onDisconnect));
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200334
335 /* Start the handshake, the rest will be done in onReceive() */
336 int ret = mbedtls_ssl_handshake(&_ssl);
337 if (ret < 0) {
338 if (ret != MBEDTLS_ERR_SSL_WANT_READ &&
339 ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
340 print_mbedtls_error("mbedtls_ssl_handshake", ret);
341 _error = true;
342 }
343 return;
344 }
345 }
346 /**
347 * On Receive handler
348 * Parses the response from the server, to check for the HTTPS 200 status code and the expected response ("Hello World!")
349 */
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200350 void onReceive(Socket *s) {
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200351 if (_error)
352 return;
353
354 /* Send request if not done yet */
355 if (!_request_sent) {
356 int ret = mbedtls_ssl_write(&_ssl, (const unsigned char *) _buffer, _bpos);
357 if (ret < 0) {
358 if (ret != MBEDTLS_ERR_SSL_WANT_READ &&
359 ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
360 print_mbedtls_error("mbedtls_ssl_write", ret);
361 _error = true;
362 }
363 return;
364 }
365
366 /* If we get here, the request was sent */
367 _request_sent = 1;
368
369 /* It also means the handshake is done, time to print info */
370 printf("TLS connection to %s established\r\n", HTTPS_SERVER_NAME);
371 {
372 char buf[1024];
373 mbedtls_x509_crt_info(buf, sizeof(buf), "\r ",
374 mbedtls_ssl_get_peer_cert(&_ssl));
375 printf("Server certificate:\r\n%s\r", buf);
376
377#if defined(UNSAFE)
378 uint32_t flags = mbedtls_ssl_get_verify_result(&_ssl);
379 if( flags != 0 )
380 {
381 mbedtls_x509_crt_verify_info(buf, sizeof (buf), "\r ! ", flags);
382 printf("Certificate verification failed:\r\n%s\r\r\n", buf);
383 }
384 else
385#endif
386 printf("Certificate verification passed\r\n\r\n");
387 }
388 }
389
390 /* Read data out of the socket */
391 int ret = mbedtls_ssl_read(&_ssl, (unsigned char *) _buffer, sizeof(_buffer));
392 if (ret < 0) {
393 if (ret != MBEDTLS_ERR_SSL_WANT_READ &&
394 ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
395 print_mbedtls_error("mbedtls_ssl_read", ret);
396 _error = true;
397 }
398 return;
399 }
400 _bpos = static_cast<size_t>(ret);
401
402 _buffer[_bpos] = 0;
403
404 /* Check each of the flags */
405 _got200 = _got200 || strstr(_buffer, HTTPS_OK_STR) != NULL;
406 _gothello = _gothello || strstr(_buffer, HTTPS_HELLO_STR) != NULL;
407
408 /* Print status messages */
409 printf("HTTPS: Received %d chars from server\r\n", _bpos);
410 printf("HTTPS: Received 200 OK status ... %s\r\n", _got200 ? "[OK]" : "[FAIL]");
411 printf("HTTPS: Received '%s' status ... %s\r\n", HTTPS_HELLO_STR, _gothello ? "[OK]" : "[FAIL]");
412 printf("HTTPS: Received message:\r\n\r\n");
413 printf("%s", _buffer);
414 _error = !(_got200 && _gothello);
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200415
416 s->close();
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200417 }
418 /**
419 * On DNS Handler
420 * Reads the address returned by DNS, then starts the connect process.
421 */
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200422 void onDNS(Socket *s, struct socket_addr addr, const char *domain) {
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200423 /* Check that the result is a valid DNS response */
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200424 if (socket_addr_is_any(&addr)) {
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200425 /* Could not find DNS entry */
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200426 printf("Could not find DNS entry for %s", HTTPS_SERVER_NAME);
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200427 onError(s, SOCKET_ERROR_DNS_FAILED);
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200428 } else {
429 /* Start connecting to the remote host */
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200430 char buf[16];
431 _remoteAddr.setAddr(&addr);
432 _remoteAddr.fmtIPv4(buf,sizeof(buf));
433 printf("%s address: %s\r\n",domain, buf);
434 socket_error_t err = _stream.connect(_remoteAddr, _port, TCPStream::ConnectHandler_t(this, &HelloHTTPS::onConnect));
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200435
436 if (err != SOCKET_ERROR_NONE) {
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200437 onError(s, err);
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200438 }
439 }
440 }
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200441 void onDisconnect(TCPStream *s) {
442 s->close();
443 minar::Scheduler::stop();
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200444 }
445
446protected:
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200447 TCPStream _stream; /**< The TCP Socket */
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200448 const char *_domain; /**< The domain name of the HTTPS server */
449 const uint16_t _port; /**< The HTTPS server port */
450 char _buffer[RECV_BUFFER_SIZE]; /**< The response buffer */
451 size_t _bpos; /**< The current offset in the response buffer */
Manuel Pégourié-Gonnardae5398a2015-08-04 14:10:28 +0200452 SocketAddr _remoteAddr; /**< The remote address */
Manuel Pégourié-Gonnard63e7eba2015-07-28 14:17:48 +0200453 volatile bool _got200; /**< Status flag for HTTPS 200 */
454 volatile bool _gothello; /**< Status flag for finding the test string */
455 volatile bool _error; /**< Status flag for an error */
456 volatile bool _disconnected;
457 volatile bool _request_sent;
458
459 mbedtls_entropy_context _entropy;
460 mbedtls_ctr_drbg_context _ctr_drbg;
461 mbedtls_x509_crt _cacert;
462 mbedtls_ssl_context _ssl;
463 mbedtls_ssl_config _ssl_conf;
464};
465
466/**
467 * The main loop of the HTTPS Hello World test
468 */
469int example_client() {
470 EthernetInterface eth;
471 /* Initialise with DHCP, connect, and start up the stack */
472 eth.init();
473 eth.connect();
474 lwipv4_socket_init();
475
476 printf("\r\n\r\n");
477 printf("Client IP Address is %s\r\n", eth.getIPAddress());
478
479 HelloHTTPS hello(HTTPS_SERVER_NAME, HTTPS_SERVER_PORT);
480 socket_error_t rc = hello.startTest(HTTPS_PATH);
481 if (rc != SOCKET_ERROR_NONE) {
482 return 1;
483 }
484 while (!hello.done()) {
485 __WFI();
486 }
487 if (hello.error()) {
488 printf("Failed to fetch %s from %s:%d\r\n", HTTPS_PATH, HTTPS_SERVER_NAME, HTTPS_SERVER_PORT);
489 }
490 /* Shut down the socket before the ethernet interface */
491 hello.close();
492 eth.disconnect();
493 return static_cast<int>(hello.error());
494}
495
496#include "mbed/test_env.h"
497
498int main() {
499 /* The default 9600 bps is too slow to print full TLS debug info and could
500 * cause the other party to time out. Select a higher baud rate for
501 * printf(), regardless of debug level for the sake of uniformity. */
502 Serial pc(USBTX, USBRX);
503 pc.baud(115200);
504
505 MBED_HOSTTEST_TIMEOUT(120);
506 MBED_HOSTTEST_SELECT(default);
507 MBED_HOSTTEST_DESCRIPTION(mbed TLS example HTTPS client);
508 MBED_HOSTTEST_START("MBEDTLS_EX_HTTPS_CLIENT");
509 MBED_HOSTTEST_RESULT(example_client() == 0);
510}
511
512#endif /* TARGET_LIKE_MBED */