Overview
Features
Download
Documentation
Community
Add-Ons & Services

hotmail acount with port 587

A general discussion forum.

hotmail acount with port 587

Postby mikemann » 13 Jan 2014, 13:17

Hello,

i have a problem with the access of a Hotmail email account with POCO libraries
I get the NetException "Unacceptable Certificate from..." from the following code :

/****************************************************************************************************
try {
SecureSMTPClientSession session(host, port);
session.open();
// Initialize the NetSSL library, as well as the underlying OpenSSL libraries
initializeSSL();
// ask the user via console
//SharedPtr<InvalidCertificateHandler> ptrHandler = new ConsoleCertificateHandler(false);
// always accept even if error occurred
SharedPtr<InvalidCertificateHandler> ptrHandler = new AcceptCertificateHandler(false);
Context::Ptr ptrContext = new Context(Context::CLIENT_USE, "", "", "",
Context::VERIFY_RELAXED, 9, true, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
SSLManager::instance().initializeClient(0, ptrHandler, ptrContext);

try {
// TLS begins with an unsecured connection
session.login();
// Upgrades to secured connection once the information is sent
if (session.startTLS(ptrContext))
{
session.login(SMTPClientSession::AUTH_LOGIN, user, password);
session.sendMessage(message);
cout << "Message successfully sent" << endl;
}
session.close();
uninitializeSSL();
} catch (SMTPException &e) {
cerr << e.displayText() << endl;
session.close();
uninitializeSSL();
return 0;
}
}
catch (NetException &e) {
cerr << e.displayText() << endl;
return 0;
}
/****************************************************************************************************
Other email acounts work.
Can anybody help me whats wrong?

Thank you
mikemann
 
Posts: 1
Joined: 13 Jan 2014, 13:06

Re: hotmail acount with port 587

Postby guenter » 16 Jan 2014, 11:11

Try disabling extended certificate validation (hostname validation):

Code: Select all
ptrContext->enableExtendedCertificateVerification(false); // after creating the Context
guenter
 
Posts: 1107
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron