openssl establish secure connection using Curl fetch public certificate to a website openssl s_client -connect example.com:443 -showcerts </dev/null 2>/dev/null | openssl x509 -outform PEM > ca.crt generate self-signed certificate openssl req -newkey rsa:2048 -nodes -keyout client.key -x509 -days 365 -out client.crt use secure cUrl curl --cacert /path/to/ca.crt --cert /path/to/client.crt --key /path/to/client.key https://example.com/api openssl commands Check a Certificate Signing Request (CSR) openssl req -text -noout -verify -in CSR.csr Check a private key openssl rsa -in privateKey.key -check Check a certificate openssl x509 -in certificate.crt -text -noout Check a PKCS#12 file (.pfx or .p12) openssl pkcs12 -info -in keyStore.p12