1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Make auth_mode=required the default in ssl_client2

This commit is contained in:
Manuel Pégourié-Gonnard
2014-03-11 11:10:27 +01:00
parent e2ce2112ac
commit fcf2fc2960
3 changed files with 18 additions and 3 deletions

View File

@ -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" );