Make endpoint+transport args of config_defaults()
diff --git a/programs/ssl/dtls_client.c b/programs/ssl/dtls_client.c
index cacfe0f..09cea3b 100644
--- a/programs/ssl/dtls_client.c
+++ b/programs/ssl/dtls_client.c
@@ -162,7 +162,9 @@
mbedtls_printf( " . Setting up the DTLS structure..." );
fflush( stdout );
- if( ( ret = mbedtls_ssl_config_defaults( &conf ) ) != 0 )
+ if( ( ret = mbedtls_ssl_config_defaults( &conf,
+ MBEDTLS_SSL_IS_CLIENT,
+ MBEDTLS_SSL_TRANSPORT_DATAGRAM ) ) != 0 )
{
mbedtls_printf( " failed\n ! mbedtls_ssl_config_defaults returned %d\n\n", ret );
goto exit;
@@ -176,9 +178,6 @@
mbedtls_printf( " ok\n" );
- mbedtls_ssl_set_endpoint( &ssl, MBEDTLS_SSL_IS_CLIENT );
- mbedtls_ssl_set_transport( &ssl, MBEDTLS_SSL_TRANSPORT_DATAGRAM );
-
/* OPTIONAL is usually a bad choice for security, but makes interop easier
* in this simplified example, in which the ca chain is hardcoded.
* Production code should set a proper ca chain and use REQUIRED. */