mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-05 22:19:11 +01:00
Make endpoint+transport args of config_defaults()
This commit is contained in:
parent
def0bbe3ab
commit
419d5ae419
14 changed files with 98 additions and 103 deletions
|
|
@ -162,7 +162,9 @@ int main( int argc, char *argv[] )
|
|||
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 @@ int main( int argc, char *argv[] )
|
|||
|
||||
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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue