title: Unable to verify server certificate through Poco
body: <p>I'm trying to implement certificate verification in my client.
  I'm always getting <code>SSL Exception: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed after 893ms</code> and I'm sure it is valid, tried getting google.com this way and failed. I am using RejectCertificateHandler because the documentation states:</p>
  
  <blockquote>
    <p>A RejectCertificateHandler is invoked whenever an error occurs
    verifying the certificate. It always rejects the certificate.</p>
    
    <p>A AcceptCertificateHandler is invoked whenever an error occurs
    verifying the certificate. It always accepts the certificate. Should
    be using for testing purposes only.</p>
  </blockquote>
  
  <p>What am I doing wrong? Here's my code:</p>
  
  <pre><code>Poco::SharedPtr&lt;Poco::Net::InvalidCertificateHandler&gt; pAcceptCertHandler = new Poco::Net::RejectCertificateHandler(true);
  
  Poco::Net::Context::Ptr pContext = new Poco::Net::Context(Poco::Net::Context::CLIENT_USE, "", "", "", Poco::Net::Context::VERIFY_RELAXED, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
  Poco::Net::SSLManager::instance().initializeClient(NULL, pAcceptCertHandler, pContext);
  
  Poco::Net::HTTPSClientSession session(uri.getHost(), uri.getPort(), pContext);
  std::string path(uri.getPathAndQuery());
  
  Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, path, Poco::Net::HTTPMessage::HTTP_1_1);
  initializeHttpGetRequest(request);
  session.sendRequest(request);
  session.setKeepAlive(true);
  
  Poco::Timespan timespan(0, 0, 10, 0, 0);
  session.setKeepAliveTimeout(timespan);
  
  Poco::Net::HTTPResponse res;
  std::istream &amp; is = session.receiveResponse(res);
  
  responseCode = res.getStatus();
  </code></pre>