
The documentation for s_client says the directory you point to must be in "hash format" and to check the documentation for verify which says files must be named in the format "hash.0" as described in the documentation for x509 which gives us our answer: the directory pointed to by -CApath can't just have files with any old names, they must be named based on their encrypted "Certificate Subject Names" which you can get from openssl.exe x509Īs an example, if you'd exported a.
Openssl connect windows#
Using this method on Windows has one extra step. Run openssl.exe with the option -CAfile x:/path/to/your/new/file.cer and you as long as your file is the correct Root CA you shouldn't get that error.īut what you asked about was -CApath which allows you to have multiple CA files and it will check against whichever is appropriate. If you only need to check against a single CA, you're now basically done. Right Click > All Tasks > Export brings up the Export Wizard, and "Base-64 encoded X.509" will get you a pem file you can save out. From there select the appropriate Certificate Authority (as an example, if you're authenticating against LetsEncrypt / Certbot, the CA in 2021 is "ISRG Root X1"). Win+R > certmgr opens the program, and then Certificates - Local Computer > Trusted Root Certification Authorities > Certificates opens the list.
Openssl connect download#
You can download them from the internet, or if you run Certificate Manager you can grab them from your own computer. In *nix it's easy since those are files, but in Windows those are stored as registry entries. That error is because openssl.exe wants you to tell it where to get root CA certs. You can specify the path to that file with the CAfile command line argument (Case sensitive: Large CA, small file.): -CAfile arg - PEM format file of CA'sĪnd one easy way to get such a PEM bundle is to download it from the testssl.sh site: Īnd this will then work with a Windows installation of OpenSSL: c:\> openssl s_client -connect :443 -CAfile "c:\Microsoft.pem"

However, I still get the same result so I'm not so sure if I understand this correctly. Then the ca path parameter goes like this one below. I'm not too familiar with unix so I assume if my CA are in C:\OpenSSL-Win64\bin\cas The only problem I have is that most online example are using unix based systems so the examples are usually like the one just above. These are also used when building the client certificate chain.

This directory must be in "hash format", see verify for more information. The directory to use for server certificate verification. Verify error:num=21:unable to verify the first certificateĪfter a few search I realize that I need to specify the path for the trusted root ca. Verify error:num=20:unable to get local issuer certificate I'm new to using OpenSSL and currently using it in Windows trying to troubleshoot for the party connecting to our server.
