samedi 25 janvier 2020

SSL Exception: Cannot create SSL_CTX object in POCO HTTPS client

I am using the POCO C++ libraries to create a HTTPS client for connecting to a SOAP service. Following is the code

std::unique_ptr<Poco::Net::HTTPClientSession> session;
Poco::Net::Context::Ptr context;
                    context = new Poco::Net::Context(
                                    Poco::Net::Context::CLIENT_USE, key, cert, "",
                                    Poco::Net::Context::VERIFY_RELAXED, 9, true,
                                    "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
session = std::make_unique<Poco::Net::HTTPSClientSession>(uri.getHost(), uri.getPort(), context);

Now the code runs fine in production. However occasionally I start getting the followng error

SSL Exception: Cannot create SSL_CTX object: error:140A90A1:SSL routines:SSL_CTX_new:library has no ciphers"

When I say occasional, I mean the error shows up after 15-20 days and the only way to recover from it is to restart the service. Now the service is multi threaded and I am using two worker threads. Can anyone recommend a solution or reason of this error?

Aucun commentaire:

Enregistrer un commentaire