HTTPS with Poco: Certificate verify failed
<p>I'm trying to get HTTPS running using the POCO library using this little program:<br></p>

<pre><code>int main()
{
    // For debugging purposes to inspect verification errors.
    SharedPtr&lt;InvalidCertHandler&gt; invalidCertHandler(new InvalidCertHandler());

    URI uri("https://google.com/");

    Context::Ptr ctx = new Context(Context::CLIENT_USE, "", Context::VerificationMode::VERIFY_RELAXED, 9, true);
    SSLManager::instance().initializeClient(nullptr, invalidCertHandler, ctx);
    HTTPSClientSession httpSession(uri.getHost(), uri.getPort(), ctx);
    HTTPRequest request(HTTPRequest::HTTP_GET, uri.getPath(), HTTPRequest::HTTP_1_1);
    HTTPResponse response;

    try
    {
        httpSession.sendRequest(request);
        httpSession.receiveResponse(response);
    }
    catch (Exception ex)
    {
        cout &lt;&lt; ex.message() &lt;&lt; endl;
        return -1;
    }

    cout &lt;&lt; "Success" &lt;&lt; endl;
    return 0;
}
</code></pre>

<p>Unfortunately I always get the following exception message when running the program:</p>

<pre><code>error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
</code></pre>

<p>And the following message in my <code>InvalidCertHandler</code>:</p>

<pre><code>unable to get local issuer certificate
</code></pre>

<p>After that I opened <code>https://google.com/</code>in <code>Google Chrome</code> and exported the certificate in <code>Base64-encoded X.509 Format (.CER)</code> and initialized the <code>Context</code> with the absolute path of the <code>.cer</code> file instead of just an empty string. That didn't work too.</p>

<p>I don't know what I'm doing wrong here but I would like to know.<br>
Can anyone of you help me out on this?</p>