mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 00:05:38 +00:00
Use mbedtls_ssl_get_peer_cert() to query peer cert in cert_app
This commit is contained in:
parent
a1ab9be367
commit
57b33c9e4e
|
@ -467,9 +467,12 @@ int main( int argc, char *argv[] )
|
||||||
/*
|
/*
|
||||||
* 5. Print the certificate
|
* 5. Print the certificate
|
||||||
*/
|
*/
|
||||||
|
#if !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE)
|
||||||
|
mbedtls_printf( " . Peer certificate information ... skipped\n" );
|
||||||
|
#else
|
||||||
mbedtls_printf( " . Peer certificate information ...\n" );
|
mbedtls_printf( " . Peer certificate information ...\n" );
|
||||||
ret = mbedtls_x509_crt_info( (char *) buf, sizeof( buf ) - 1, " ",
|
ret = mbedtls_x509_crt_info( (char *) buf, sizeof( buf ) - 1, " ",
|
||||||
ssl.session->peer_cert );
|
mbedtls_ssl_get_peer_cert( &ssl ) );
|
||||||
if( ret == -1 )
|
if( ret == -1 )
|
||||||
{
|
{
|
||||||
mbedtls_printf( " failed\n ! mbedtls_x509_crt_info returned %d\n\n", ret );
|
mbedtls_printf( " failed\n ! mbedtls_x509_crt_info returned %d\n\n", ret );
|
||||||
|
@ -477,6 +480,7 @@ int main( int argc, char *argv[] )
|
||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_printf( "%s\n", buf );
|
mbedtls_printf( "%s\n", buf );
|
||||||
|
#endif /* MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */
|
||||||
|
|
||||||
mbedtls_ssl_close_notify( &ssl );
|
mbedtls_ssl_close_notify( &ssl );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue