mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-07 23:18:59 +01:00
Make auth_mode=required the default in ssl_client2
This commit is contained in:
parent
e2ce2112ac
commit
fcf2fc2960
3 changed files with 18 additions and 3 deletions
|
|
@ -155,6 +155,8 @@ int main( int argc, char *argv[] )
|
|||
printf( " ok\n" );
|
||||
|
||||
ssl_set_endpoint( &ssl, SSL_IS_CLIENT );
|
||||
/* OPTIONAL is not optimal for security,
|
||||
* but makes interop easier in this simplified example */
|
||||
ssl_set_authmode( &ssl, SSL_VERIFY_OPTIONAL );
|
||||
ssl_set_ca_chain( &ssl, &cacert, NULL, "PolarSSL Server 1" );
|
||||
|
||||
|
|
@ -185,6 +187,7 @@ int main( int argc, char *argv[] )
|
|||
*/
|
||||
printf( " . Verifying peer X.509 certificate..." );
|
||||
|
||||
/* In real life, we may want to bail out when ret != 0 */
|
||||
if( ( ret = ssl_get_verify_result( &ssl ) ) != 0 )
|
||||
{
|
||||
printf( " failed\n" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue