blob: c9f8b3c7045a947d72da30c194b315fce877c747 [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/*
2 * SSL client demonstration program
3 *
Bence Szépkúti1e148272020-08-07 13:07:28 +02004 * Copyright The Mbed TLS Contributors
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +02005 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
Paul Bakker5121ce52009-01-03 21:22:43 +000018 */
19
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020020#if !defined(MBEDTLS_CONFIG_FILE)
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000021#include "mbedtls/config.h"
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020022#else
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020023#include MBEDTLS_CONFIG_FILE
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020024#endif
Paul Bakker5121ce52009-01-03 21:22:43 +000025
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000026#include "mbedtls/platform.h"
Rich Evansf90016a2015-01-19 14:26:37 +000027
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020028#if !defined(MBEDTLS_BIGNUM_C) || !defined(MBEDTLS_ENTROPY_C) || \
29 !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_CLI_C) || \
30 !defined(MBEDTLS_NET_C) || !defined(MBEDTLS_RSA_C) || \
31 !defined(MBEDTLS_CERTS_C) || !defined(MBEDTLS_PEM_PARSE_C) || \
32 !defined(MBEDTLS_CTR_DRBG_C) || !defined(MBEDTLS_X509_CRT_PARSE_C)
Rich Evans85b05ec2015-02-12 11:37:29 +000033int main( void )
Paul Bakker5690efc2011-05-26 13:16:06 +000034{
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020035 mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or "
36 "MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or "
37 "MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or "
38 "MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C "
Paul Bakkered27a042013-04-18 22:46:23 +020039 "not defined.\n");
Krzysztof Stachowiak5e1b1952019-04-24 14:24:46 +020040 mbedtls_exit( 0 );
Paul Bakker5690efc2011-05-26 13:16:06 +000041}
42#else
Manuel Pégourié-Gonnard4b3e5ef2015-03-27 11:24:27 +010043
Andres AG788aa4a2016-09-14 14:32:09 +010044#include "mbedtls/net_sockets.h"
Manuel Pégourié-Gonnard4b3e5ef2015-03-27 11:24:27 +010045#include "mbedtls/debug.h"
46#include "mbedtls/ssl.h"
47#include "mbedtls/entropy.h"
48#include "mbedtls/ctr_drbg.h"
49#include "mbedtls/error.h"
50#include "mbedtls/certs.h"
51
52#include <string.h>
53
Manuel Pégourié-Gonnardc0d74942015-06-23 12:30:57 +020054#define SERVER_PORT "4433"
Manuel Pégourié-Gonnard4b3e5ef2015-03-27 11:24:27 +010055#define SERVER_NAME "localhost"
56#define GET_REQUEST "GET / HTTP/1.0\r\n\r\n"
57
58#define DEBUG_LEVEL 1
59
Simon Butcher63cb97e2018-12-06 17:43:31 +000060
Manuel Pégourié-Gonnard61ee3512015-06-23 17:35:03 +020061static void my_debug( void *ctx, int level,
62 const char *file, int line,
63 const char *str )
Paul Bakker9a97c5d2013-09-15 17:07:33 +020064{
Paul Bakkerc73079a2014-04-25 16:34:30 +020065 ((void) level);
66
Manuel Pégourié-Gonnard61ee3512015-06-23 17:35:03 +020067 mbedtls_fprintf( (FILE *) ctx, "%s:%04d: %s", file, line, str );
Paul Bakkerc73079a2014-04-25 16:34:30 +020068 fflush( (FILE *) ctx );
Paul Bakker9a97c5d2013-09-15 17:07:33 +020069}
70
Rich Evans85b05ec2015-02-12 11:37:29 +000071int main( void )
Paul Bakker5121ce52009-01-03 21:22:43 +000072{
Andres Amaya Garcia55172022018-04-29 20:53:53 +010073 int ret = 1, len;
74 int exit_code = MBEDTLS_EXIT_FAILURE;
Manuel Pégourié-Gonnard5db64322015-06-30 15:40:39 +020075 mbedtls_net_context server_fd;
Manuel Pégourié-Gonnarde6ef16f2015-05-11 19:54:43 +020076 uint32_t flags;
Paul Bakker5121ce52009-01-03 21:22:43 +000077 unsigned char buf[1024];
Paul Bakkeref3f8c72013-06-24 13:01:08 +020078 const char *pers = "ssl_client1";
Paul Bakker508ad5a2011-12-04 17:09:26 +000079
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020080 mbedtls_entropy_context entropy;
81 mbedtls_ctr_drbg_context ctr_drbg;
82 mbedtls_ssl_context ssl;
Manuel Pégourié-Gonnarddef0bbe2015-05-04 14:56:36 +020083 mbedtls_ssl_config conf;
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020084 mbedtls_x509_crt cacert;
Paul Bakker5121ce52009-01-03 21:22:43 +000085
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020086#if defined(MBEDTLS_DEBUG_C)
87 mbedtls_debug_set_threshold( DEBUG_LEVEL );
Paul Bakkerc73079a2014-04-25 16:34:30 +020088#endif
89
Paul Bakker5121ce52009-01-03 21:22:43 +000090 /*
91 * 0. Initialize the RNG and the session data
92 */
Manuel Pégourié-Gonnard5db64322015-06-30 15:40:39 +020093 mbedtls_net_init( &server_fd );
Manuel Pégourié-Gonnard41d479e2015-04-29 00:48:22 +020094 mbedtls_ssl_init( &ssl );
Manuel Pégourié-Gonnarddef0bbe2015-05-04 14:56:36 +020095 mbedtls_ssl_config_init( &conf );
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020096 mbedtls_x509_crt_init( &cacert );
Manuel Pégourié-Gonnardec160c02015-04-28 22:52:30 +020097 mbedtls_ctr_drbg_init( &ctr_drbg );
Paul Bakker5121ce52009-01-03 21:22:43 +000098
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020099 mbedtls_printf( "\n . Seeding the random number generator..." );
Paul Bakker508ad5a2011-12-04 17:09:26 +0000100 fflush( stdout );
101
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200102 mbedtls_entropy_init( &entropy );
Manuel Pégourié-Gonnardec160c02015-04-28 22:52:30 +0200103 if( ( ret = mbedtls_ctr_drbg_seed( &ctr_drbg, mbedtls_entropy_func, &entropy,
Paul Bakkeref3f8c72013-06-24 13:01:08 +0200104 (const unsigned char *) pers,
105 strlen( pers ) ) ) != 0 )
Paul Bakker508ad5a2011-12-04 17:09:26 +0000106 {
Manuel Pégourié-Gonnardec160c02015-04-28 22:52:30 +0200107 mbedtls_printf( " failed\n ! mbedtls_ctr_drbg_seed returned %d\n", ret );
Paul Bakker508ad5a2011-12-04 17:09:26 +0000108 goto exit;
109 }
110
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200111 mbedtls_printf( " ok\n" );
Paul Bakker508ad5a2011-12-04 17:09:26 +0000112
Paul Bakker5121ce52009-01-03 21:22:43 +0000113 /*
Paul Bakker75242c32012-11-17 00:03:46 +0100114 * 0. Initialize certificates
115 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200116 mbedtls_printf( " . Loading the CA root certificate ..." );
Paul Bakker75242c32012-11-17 00:03:46 +0100117 fflush( stdout );
118
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200119 ret = mbedtls_x509_crt_parse( &cacert, (const unsigned char *) mbedtls_test_cas_pem,
120 mbedtls_test_cas_pem_len );
Paul Bakker75242c32012-11-17 00:03:46 +0100121 if( ret < 0 )
122 {
Kenneth Soerensen518d4352020-04-01 17:22:45 +0200123 mbedtls_printf( " failed\n ! mbedtls_x509_crt_parse returned -0x%x\n\n", (unsigned int) -ret );
Paul Bakker75242c32012-11-17 00:03:46 +0100124 goto exit;
125 }
126
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200127 mbedtls_printf( " ok (%d skipped)\n", ret );
Paul Bakker75242c32012-11-17 00:03:46 +0100128
129 /*
Paul Bakker5121ce52009-01-03 21:22:43 +0000130 * 1. Start the connection
131 */
Manuel Pégourié-Gonnardc0d74942015-06-23 12:30:57 +0200132 mbedtls_printf( " . Connecting to tcp/%s/%s...", SERVER_NAME, SERVER_PORT );
Paul Bakker5121ce52009-01-03 21:22:43 +0000133 fflush( stdout );
134
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200135 if( ( ret = mbedtls_net_connect( &server_fd, SERVER_NAME,
136 SERVER_PORT, MBEDTLS_NET_PROTO_TCP ) ) != 0 )
Paul Bakker5121ce52009-01-03 21:22:43 +0000137 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200138 mbedtls_printf( " failed\n ! mbedtls_net_connect returned %d\n\n", ret );
Paul Bakker5121ce52009-01-03 21:22:43 +0000139 goto exit;
140 }
141
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200142 mbedtls_printf( " ok\n" );
Paul Bakker5121ce52009-01-03 21:22:43 +0000143
144 /*
145 * 2. Setup stuff
146 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200147 mbedtls_printf( " . Setting up the SSL/TLS structure..." );
Paul Bakker5121ce52009-01-03 21:22:43 +0000148 fflush( stdout );
149
Manuel Pégourié-Gonnard419d5ae2015-05-04 19:32:36 +0200150 if( ( ret = mbedtls_ssl_config_defaults( &conf,
151 MBEDTLS_SSL_IS_CLIENT,
Manuel Pégourié-Gonnardb31c5f62015-06-17 13:53:47 +0200152 MBEDTLS_SSL_TRANSPORT_STREAM,
153 MBEDTLS_SSL_PRESET_DEFAULT ) ) != 0 )
Manuel Pégourié-Gonnarddef0bbe2015-05-04 14:56:36 +0200154 {
155 mbedtls_printf( " failed\n ! mbedtls_ssl_config_defaults returned %d\n\n", ret );
156 goto exit;
157 }
158
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200159 mbedtls_printf( " ok\n" );
Paul Bakker5121ce52009-01-03 21:22:43 +0000160
Manuel Pégourié-Gonnardfcf2fc22014-03-11 11:10:27 +0100161 /* OPTIONAL is not optimal for security,
162 * but makes interop easier in this simplified example */
Manuel Pégourié-Gonnard6729e792015-05-11 09:50:24 +0200163 mbedtls_ssl_conf_authmode( &conf, MBEDTLS_SSL_VERIFY_OPTIONAL );
164 mbedtls_ssl_conf_ca_chain( &conf, &cacert, NULL );
Manuel Pégourié-Gonnard06939ce2015-05-11 11:25:46 +0200165 mbedtls_ssl_conf_rng( &conf, mbedtls_ctr_drbg_random, &ctr_drbg );
166 mbedtls_ssl_conf_dbg( &conf, my_debug, stdout );
167
168 if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 )
169 {
170 mbedtls_printf( " failed\n ! mbedtls_ssl_setup returned %d\n\n", ret );
171 goto exit;
172 }
173
Paul Bakker23828162016-07-22 11:54:30 +0100174 if( ( ret = mbedtls_ssl_set_hostname( &ssl, SERVER_NAME ) ) != 0 )
Manuel Pégourié-Gonnardbc2b7712015-05-06 11:14:19 +0100175 {
176 mbedtls_printf( " failed\n ! mbedtls_ssl_set_hostname returned %d\n\n", ret );
177 goto exit;
178 }
Paul Bakker5121ce52009-01-03 21:22:43 +0000179
Manuel Pégourié-Gonnard1b511f92015-05-06 15:54:23 +0100180 mbedtls_ssl_set_bio( &ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL );
Paul Bakker5121ce52009-01-03 21:22:43 +0000181
Paul Bakker5121ce52009-01-03 21:22:43 +0000182 /*
Paul Bakker75242c32012-11-17 00:03:46 +0100183 * 4. Handshake
184 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200185 mbedtls_printf( " . Performing the SSL/TLS handshake..." );
Paul Bakker75242c32012-11-17 00:03:46 +0100186 fflush( stdout );
187
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200188 while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 )
Paul Bakker75242c32012-11-17 00:03:46 +0100189 {
Manuel Pégourié-Gonnard88369942015-05-06 16:19:31 +0100190 if( ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE )
Paul Bakker75242c32012-11-17 00:03:46 +0100191 {
Kenneth Soerensen518d4352020-04-01 17:22:45 +0200192 mbedtls_printf( " failed\n ! mbedtls_ssl_handshake returned -0x%x\n\n", (unsigned int) -ret );
Paul Bakker75242c32012-11-17 00:03:46 +0100193 goto exit;
194 }
195 }
196
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200197 mbedtls_printf( " ok\n" );
Paul Bakker75242c32012-11-17 00:03:46 +0100198
199 /*
200 * 5. Verify the server certificate
201 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200202 mbedtls_printf( " . Verifying peer X.509 certificate..." );
Paul Bakker75242c32012-11-17 00:03:46 +0100203
Manuel Pégourié-Gonnard89addc42015-04-20 10:56:18 +0100204 /* In real life, we probably want to bail out when ret != 0 */
Manuel Pégourié-Gonnarde6ef16f2015-05-11 19:54:43 +0200205 if( ( flags = mbedtls_ssl_get_verify_result( &ssl ) ) != 0 )
Paul Bakker75242c32012-11-17 00:03:46 +0100206 {
Manuel Pégourié-Gonnard89addc42015-04-20 10:56:18 +0100207 char vrfy_buf[512];
208
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200209 mbedtls_printf( " failed\n" );
Paul Bakker75242c32012-11-17 00:03:46 +0100210
Manuel Pégourié-Gonnarde6ef16f2015-05-11 19:54:43 +0200211 mbedtls_x509_crt_verify_info( vrfy_buf, sizeof( vrfy_buf ), " ! ", flags );
Paul Bakker75242c32012-11-17 00:03:46 +0100212
Manuel Pégourié-Gonnard89addc42015-04-20 10:56:18 +0100213 mbedtls_printf( "%s\n", vrfy_buf );
Paul Bakker75242c32012-11-17 00:03:46 +0100214 }
215 else
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200216 mbedtls_printf( " ok\n" );
Paul Bakker75242c32012-11-17 00:03:46 +0100217
218 /*
Paul Bakker5121ce52009-01-03 21:22:43 +0000219 * 3. Write the GET request
220 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200221 mbedtls_printf( " > Write to server:" );
Paul Bakker5121ce52009-01-03 21:22:43 +0000222 fflush( stdout );
223
224 len = sprintf( (char *) buf, GET_REQUEST );
225
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200226 while( ( ret = mbedtls_ssl_write( &ssl, buf, len ) ) <= 0 )
Paul Bakker5121ce52009-01-03 21:22:43 +0000227 {
Manuel Pégourié-Gonnard88369942015-05-06 16:19:31 +0100228 if( ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE )
Paul Bakker5121ce52009-01-03 21:22:43 +0000229 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200230 mbedtls_printf( " failed\n ! mbedtls_ssl_write returned %d\n\n", ret );
Paul Bakker5121ce52009-01-03 21:22:43 +0000231 goto exit;
232 }
233 }
234
235 len = ret;
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200236 mbedtls_printf( " %d bytes written\n\n%s", len, (char *) buf );
Paul Bakker5121ce52009-01-03 21:22:43 +0000237
238 /*
239 * 7. Read the HTTP response
240 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200241 mbedtls_printf( " < Read from server:" );
Paul Bakker5121ce52009-01-03 21:22:43 +0000242 fflush( stdout );
243
244 do
245 {
246 len = sizeof( buf ) - 1;
247 memset( buf, 0, sizeof( buf ) );
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200248 ret = mbedtls_ssl_read( &ssl, buf, len );
Paul Bakker5121ce52009-01-03 21:22:43 +0000249
Manuel Pégourié-Gonnard88369942015-05-06 16:19:31 +0100250 if( ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE )
Paul Bakker5121ce52009-01-03 21:22:43 +0000251 continue;
252
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200253 if( ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY )
Paul Bakker5121ce52009-01-03 21:22:43 +0000254 break;
255
Paul Bakker61da7522011-11-11 10:28:58 +0000256 if( ret < 0 )
Paul Bakker5121ce52009-01-03 21:22:43 +0000257 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200258 mbedtls_printf( "failed\n ! mbedtls_ssl_read returned %d\n\n", ret );
Paul Bakker5121ce52009-01-03 21:22:43 +0000259 break;
260 }
261
Paul Bakker61da7522011-11-11 10:28:58 +0000262 if( ret == 0 )
263 {
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200264 mbedtls_printf( "\n\nEOF\n\n" );
Paul Bakker61da7522011-11-11 10:28:58 +0000265 break;
266 }
267
Paul Bakker5121ce52009-01-03 21:22:43 +0000268 len = ret;
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200269 mbedtls_printf( " %d bytes read\n\n%s", len, (char *) buf );
Paul Bakker5121ce52009-01-03 21:22:43 +0000270 }
Paul Bakker61da7522011-11-11 10:28:58 +0000271 while( 1 );
Paul Bakker5121ce52009-01-03 21:22:43 +0000272
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200273 mbedtls_ssl_close_notify( &ssl );
Paul Bakker5121ce52009-01-03 21:22:43 +0000274
Andres Amaya Garcia55172022018-04-29 20:53:53 +0100275 exit_code = MBEDTLS_EXIT_SUCCESS;
276
Paul Bakker5121ce52009-01-03 21:22:43 +0000277exit:
278
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200279#ifdef MBEDTLS_ERROR_C
Andres Amaya Garcia55172022018-04-29 20:53:53 +0100280 if( exit_code != MBEDTLS_EXIT_SUCCESS )
Paul Bakkera3d195c2011-11-27 21:07:34 +0000281 {
282 char error_buf[100];
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200283 mbedtls_strerror( ret, error_buf, 100 );
284 mbedtls_printf("Last error was: %d - %s\n\n", ret, error_buf );
Paul Bakkera3d195c2011-11-27 21:07:34 +0000285 }
286#endif
287
Manuel Pégourié-Gonnard3d7d00a2015-06-30 15:55:03 +0200288 mbedtls_net_free( &server_fd );
Paul Bakker0c226102014-04-17 16:02:36 +0200289
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200290 mbedtls_x509_crt_free( &cacert );
291 mbedtls_ssl_free( &ssl );
Manuel Pégourié-Gonnarddef0bbe2015-05-04 14:56:36 +0200292 mbedtls_ssl_config_free( &conf );
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200293 mbedtls_ctr_drbg_free( &ctr_drbg );
294 mbedtls_entropy_free( &entropy );
Paul Bakker5121ce52009-01-03 21:22:43 +0000295
Paul Bakkercce9d772011-11-18 14:26:47 +0000296#if defined(_WIN32)
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200297 mbedtls_printf( " + Press Enter to exit this program.\n" );
Paul Bakker5121ce52009-01-03 21:22:43 +0000298 fflush( stdout ); getchar();
299#endif
300
Krzysztof Stachowiak5e1b1952019-04-24 14:24:46 +0200301 mbedtls_exit( exit_code );
Paul Bakker5121ce52009-01-03 21:22:43 +0000302}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200303#endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_SSL_TLS_C &&
304 MBEDTLS_SSL_CLI_C && MBEDTLS_NET_C && MBEDTLS_RSA_C &&
305 MBEDTLS_CERTS_C && MBEDTLS_PEM_PARSE_C && MBEDTLS_CTR_DRBG_C &&
306 MBEDTLS_X509_CRT_PARSE_C */