1 (edited by bahadirmaktav 2023-09-27 07:12:10)

Topic: How to print peer's certificates on console

Hi,

When I am using 'openssl s_client' tool, I can print peer certificates which sent from the server on console with a parameter called '-showcerts'. When I use this I can see the certificates in pem format on console.

Is there any way to print peer certificates in pem or der format on console. It does not have to be a parameter like '-showcerts', If you know which variable or which function use gets those certificates, I can put a print statement there.

I am asking this because, when I run with the openssl command like 'openssl s_client -showcerts -connect <hostname and port>', I can see the peer certificates(cert chain with two certificates), but I believe that there might be a problem about getting the right certificates from server for wolfssl.

Share

Re: How to print peer's certificates on console

Hi bahadirmaktav,

You can use the wolfSSL example client application to get similar functionality:

Build wolfSSL with

./configure --enable-all CFLAGS="-DSHOW_CERTS" && make

Run the client

./examples/client/client -h <hostname> -p <port>

Use the -j option to override CA issues

Thanks,
Eric - wolfSSL Support