mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +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
|
|
@ -1520,7 +1520,9 @@ int main( int argc, char *argv[] )
|
|||
mbedtls_printf( " . Setting up the SSL/TLS structure..." );
|
||||
fflush( stdout );
|
||||
|
||||
if( ( ret = mbedtls_ssl_config_defaults( &conf ) ) != 0 )
|
||||
if( ( ret = mbedtls_ssl_config_defaults( &conf,
|
||||
MBEDTLS_SSL_IS_SERVER,
|
||||
opt.transport ) ) != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_ssl_config_defaults returned -0x%x\n\n", -ret );
|
||||
goto exit;
|
||||
|
|
@ -1537,12 +1539,6 @@ int main( int argc, char *argv[] )
|
|||
mbedtls_ssl_set_authmode( &ssl, opt.auth_mode );
|
||||
|
||||
#if defined(MBEDTLS_SSL_PROTO_DTLS)
|
||||
if( ( ret = mbedtls_ssl_set_transport( &ssl, opt.transport ) ) != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! selected transport is not available\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( opt.hs_to_min != DFL_HS_TO_MIN || opt.hs_to_max != DFL_HS_TO_MAX )
|
||||
mbedtls_ssl_set_handshake_timeout( &ssl, opt.hs_to_min, opt.hs_to_max );
|
||||
#endif /* MBEDTLS_SSL_PROTO_DTLS */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue