title: Delphi Indy verify server certificate SSL
body: <p>I have scoured the internet and haven't found a solution or method on how to verify the certificate when connecting over HTTPS using TIdHTTP.</p>
  
  <p>I have hooked up a IdSSLIOHandlerSocketOpenSSL component as the IOHandler, set the SSLModes, etc. but when I browse to <a href="https://s3.amazonaws.com">https://s3.amazonaws.com</a> it cannot verify the certificate. </p>
  
  <p>OpenSSL (Indy) gives </p>
  
  <p>"Error connecting with SSL. SSL3_GET_SERVER_CERTIFICATE: Certificate verify failed"</p>
  
  <p>The OpenSSL libraries have successfully loaded (checked with WhichFailedToLoad). The OnStatusInfo event writes the following:</p>
  
  <p>SSL status: "before/connect initialization"</p>
  
  <p>SSL status: "before/connect initialization"</p>
  
  <p>SSL status: "SSLv2/v3 write client hello A"</p>
  
  <p>SSL status: "SSLv3 read server hello A"</p>
  
  <p>SSL status: "SSLv3 read server certificate B"</p>
  
  <p>SSL status: "SSLv3 read server certificate B"</p>
  
  <p>SSL status: "SSLv3 read server certificate B"</p>
  
  <p>And OnVerifyPeer, AOk = False.</p>
  
  <p>How can I get it to verify correctly. What's going on?</p>
  
  <p>Thanks for reading,
  Adrian</p>