diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 2c5a8cee9..f369dc840 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -1595,7 +1595,7 @@ int main( int argc, char *argv[] ) ret = mbedtls_x509_crt_parse_file( &cacert, opt.ca_file ); else #endif -#if defined(MBEDTLS_CERTS_C) +#if defined(MBEDTLS_CERTS_C) && defined(MBEDTLS_PEM_PARSE_C) for( i = 0; mbedtls_test_cas[i] != NULL; i++ ) { ret = mbedtls_x509_crt_parse( &cacert, @@ -1607,9 +1607,13 @@ int main( int argc, char *argv[] ) #else { ret = 1; - mbedtls_printf("MBEDTLS_CERTS_C not defined."); +#if !defined(MBEDTLS_CERTS_C) + mbedtls_printf( "MBEDTLS_CERTS_C not defined." ); +#else + mbedtls_printf( "All test CRTs loaded via MBEDTLS_CERTS_C are PEM-encoded, but MBEDTLS_PEM_PARSE_C is disabled." ); } -#endif +#endif /* MBEDTLS_CERTS_C */ +#endif /* MBEDTLS_CERTS_C && MBEDTLS_PEM_PARSE_C */ if( ret < 0 ) { mbedtls_printf( " failed\n ! mbedtls_x509_crt_parse returned -0x%x\n\n", -ret );