SecureSMTPClientSession bugfix: save hostname for cert validation

This commit is contained in:
Guenter Obiltschnig
2014-05-12 16:01:56 +02:00
parent e4484db61e
commit 2341a1d236
2 changed files with 6 additions and 2 deletions

View File

@@ -86,6 +86,9 @@ public:
/// ///
/// Returns true if the STARTTLS command was successful, /// Returns true if the STARTTLS command was successful,
/// false otherwise. /// false otherwise.
private:
std::string _host;
}; };

View File

@@ -31,7 +31,8 @@ SecureSMTPClientSession::SecureSMTPClientSession(const StreamSocket& socket):
SecureSMTPClientSession::SecureSMTPClientSession(const std::string& host, Poco::UInt16 port): SecureSMTPClientSession::SecureSMTPClientSession(const std::string& host, Poco::UInt16 port):
SMTPClientSession(host, port) SMTPClientSession(host, port),
_host(host)
{ {
} }
@@ -55,7 +56,7 @@ bool SecureSMTPClientSession::startTLS(Context::Ptr pContext)
status = sendCommand("STARTTLS", response); status = sendCommand("STARTTLS", response);
if (!isPositiveCompletion(status)) return false; if (!isPositiveCompletion(status)) return false;
SecureStreamSocket sss(SecureStreamSocket::attach(socket(), pContext)); SecureStreamSocket sss(SecureStreamSocket::attach(socket(), _host, pContext));
socket() = sss; socket() = sss;
return true; return true;