mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-03 13:15:42 +01:00
Move ssl_set_ca_chain() to work on config
This commit is contained in:
parent
ba26c24769
commit
bc2b771af4
14 changed files with 60 additions and 44 deletions
|
|
@ -1154,7 +1154,7 @@ int main( int argc, char *argv[] )
|
|||
if( strcmp( opt.ca_path, "none" ) != 0 &&
|
||||
strcmp( opt.ca_file, "none" ) != 0 )
|
||||
{
|
||||
mbedtls_ssl_set_ca_chain( &ssl, &cacert, NULL, opt.server_name );
|
||||
mbedtls_ssl_set_ca_chain( &conf, &cacert, NULL );
|
||||
}
|
||||
if( strcmp( opt.crt_file, "none" ) != 0 &&
|
||||
strcmp( opt.key_file, "none" ) != 0 )
|
||||
|
|
@ -1165,6 +1165,11 @@ int main( int argc, char *argv[] )
|
|||
goto exit;
|
||||
}
|
||||
}
|
||||
if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_ssl_set_hostname returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED)
|
||||
|
|
@ -1177,14 +1182,6 @@ int main( int argc, char *argv[] )
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION)
|
||||
if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 )
|
||||
{
|
||||
mbedtls_printf( " failed\n ! mbedtls_ssl_set_hostname returned %d\n\n", ret );
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( opt.min_version != DFL_MIN_VERSION )
|
||||
{
|
||||
ret = mbedtls_ssl_set_min_version( &conf, MBEDTLS_SSL_MAJOR_VERSION_3, opt.min_version );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue