title: openssl s_client Error: verify error:num=2:unable to get issuer certificate
body: <p>I need to connect to some <code>https://website.com</code>. So, the site is available via VPN. I'm connected to the VPN and I can open the site in browser.</p>
  
  <p>I've downloaded certificates from browser:</p>
  
  <p><a href="https://i.stack.imgur.com/NtpbS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NtpbS.png" alt="enter image description here"></a></p>
  
  <p>Then I <code>cat</code> both file into one <code>certificate.pem</code></p>
  
  <p>But when I'm trying to execute command</p>
  
  <pre><code>openssl s_client -connect website.com:443 -CAfile /path/to/certificate.pem
  </code></pre>
  
  <p>When I execute it in a terminal I have an error.</p>
  
  <pre><code>CONNECTED(00000003)
  depth=1 /C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA
  verify error:num=2:unable to get issuer certificate
  issuer= /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root CA
  verify return:0
  ---
  Certificate chain
   0 s:/C=AU/ST=Wales/L=Place/O=Company 
  Ltd/OU=D&amp;D/CN=website.com 
  i:/C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA
  ---
  Server certificate
  -----BEGIN CERTIFICATE-----
  ...
  -----END CERTIFICATE-----
  subject=/C=AU/ST=Wales/L=Place/O=Company 
  Ltd/OU=D&amp;D/CN=website.com
  issuer=/C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA
  ---
  No client certificate CA names sent
  ---
  SSL handshake has read 2034 bytes and written 328 bytes
  ---
  New, TLSv1/SSLv3, Cipher is DHE-RSA-AES128-SHA
  Server public key is 2048 bit
  Secure Renegotiation IS supported
  Compression: NONE
  Expansion: NONE
  SSL-Session:
      Protocol  : TLSv1
      Cipher    : DHE-RSA-AES128-SHA
      Session-ID:     1533BA958D51B9FEAE4C3534F4A417A5896ED17DCAAE83E89E6C2A7F615A583A
      Session-ID-ctx:
      Master-Key: 5CF  D4ACA242B602AAFSDF1234X23E99BD4C62862888947FACFF0E7503BA34C2DD0EC193FA525204A539
      Key-Arg   : None
      Start Time: 1509781851
      Timeout   : 300 (sec)
      Verify return code: 0 (ok)
  </code></pre>