Replies: 1 comment
-
|
This is a configuration issue, not a POCO bug. The error Your code is missing SSL configuration. Compare with the sample in #include "Poco/Net/SSLManager.h"
#include "Poco/Net/ConsoleCertificateHandler.h"
// 1. Initialize SSL
Poco::Net::initializeSSL();
// 2. Create certificate handler (handles verification failures)
SharedPtr<InvalidCertificateHandler> pCert = new ConsoleCertificateHandler(false);
// 3. Create context WITH CA certificates loaded
Context::Ptr pContext = new Context(
Context::CLIENT_USE,
"", // privateKeyFile
"", // certificateFile
"", // caLocation (empty = use default)
Context::VERIFY_RELAXED,
9, // verification depth
true, // loadDefaultCAs - THIS IS KEY!
"ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
// 4. Initialize SSL manager
SSLManager::instance().initializeClient(nullptr, pCert, pContext);
// 5. Now use SecureSMTPClientSession
SecureSMTPClientSession session(mailhost, port);
session.login();
session.startTLS(pContext); // Pass the context!
// ...Key points:
Alternative - if you want to skip verification (not recommended for production): Context::Ptr pContext = new Context(Context::CLIENT_USE, "", "", "", Context::VERIFY_NONE); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to send mail with ssl enable using below code and getting
SSL Exception: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed error
Beta Was this translation helpful? Give feedback.
All reactions