title: Verifying self signed certificate in openssl
body: <p>I type the following command </p>
  
  <pre><code>openssl s_client -showcerts -connect servername:443
  </code></pre>
  
  <p>In the SSL session I get the certificates and </p>
  
  <pre><code>Verify return code: 18 (self signed certificate)
  </code></pre>
  
  <p>I have a program that is using the certificate to talk to the server, but is not able to ..it says</p>
  
  <pre><code>Error: Failed to initiate SSL handshake with peer. There is possibly problem with your your SSL certificate.
  </code></pre>
  
  <p>I have another server and an openssl command gives Verify return code: 0 (ok) and the program connects to it with no problem.</p>
  
  <p>I donot know how the program(c++ program) is trying to connect to the servers. But does anybody know any of the possible reasons why it is not able to connect to a server with self signed certificate?</p>