title: Poco+OpenSSL, error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
body: <p>Problem with Poco library (poco-1.9.0-all) and OpenSSL (v1.1.0h from slproweb site).
  I can't establish a secure connection with any site.</p>
  
  <p>Simple code:</p>
  
  <pre><code>Poco::Net::initializeSSL();
  Poco::Net::Context* pCtx = new Poco::Net::Context(Poco::Net::Context::Usage::TLSV1_2_CLIENT_USE, "", "cacert.pem", "", Poco::Net::Context::VerificationMode::VERIFY_RELAXED, 9, false);
  Poco::Net::HTTPSClientSession cs("ya.ru", 443, pCtx);
  
  Poco::Net::HTTPRequest req(Poco::Net::HTTPRequest::HTTP_GET, "/?encoding=text", Poco::Net::HTTPMessage::HTTP_1_1);
  Poco::Net::HTTPResponse resp;
  
  try
  {
      Poco::Net::WebSocket sock(cs, req, resp);
  }
  catch (Poco::Net::SSLException&amp; e)
  {
      cout &lt;&lt; "ssl exception: " &lt;&lt; e.displayText() &lt;&lt; endl;
  }
  catch (...)
  {
  }
  </code></pre>
  
  <p>I get a exception from the poco library: 'SSL Exception: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed'.
  File cacert.pem downloaded from <a href="https://curl.haxx.se/docs/caextract.html" rel="nofollow noreferrer">https://curl.haxx.se/docs/caextract.html</a> </p>
  
  <p>OpenSSL reads it without errors by SSL_CTX_use_certificate_chain_file function in Poco::Net::Context::init(const Params&amp; params).</p>
  
  <p>If I specify the verification mode VERIFY_NONE in Poco::Net::Context constructor - connection passes without problems.</p>
  
  <p>Maybe I'm setting the wrong parameters in Poco::Net::Context constructor? </p>