mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-14 06:55:49 +02:00
SecureSMTPClientSession bugfix: save hostname for cert validation
This commit is contained in:
@@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user