DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

Why I am unable to verify the downloaded google's certificate in my C programm?

I attempt to verify an openssl certificate in a windows app that uses winsock2:

I downloaded the google's certificate in linux (I am using mingw for cross compilation and wine for execution):

mkdir -p ./release/certificates
echo | openssl s_client -servername google.com -connect google.com:443| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > google.crt

And I attempt to verify it in my programm:

#define _WINSOCK_DEPRECATED_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#include

But I fail to do so. What I try to do is to ship certificates alongside my app, but it seems it will make me strugle a bit.

Would you mind me to aid me in my problem?

Top comments (1)

Collapse
 
pcmagas profile image
Dimitrios Desyllas