mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 22:31:23 +01:00
SecureSMTPClientSession bugfix: save hostname for cert validation
This commit is contained in:
parent
e4484db61e
commit
2341a1d236
@ -86,6 +86,9 @@ public:
|
||||
///
|
||||
/// Returns true if the STARTTLS command was successful,
|
||||
/// false otherwise.
|
||||
|
||||
private:
|
||||
std::string _host;
|
||||
};
|
||||
|
||||
|
||||
|
@ -31,7 +31,8 @@ SecureSMTPClientSession::SecureSMTPClientSession(const StreamSocket& socket):
|
||||
|
||||
|
||||
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);
|
||||
if (!isPositiveCompletion(status)) return false;
|
||||
|
||||
SecureStreamSocket sss(SecureStreamSocket::attach(socket(), pContext));
|
||||
SecureStreamSocket sss(SecureStreamSocket::attach(socket(), _host, pContext));
|
||||
socket() = sss;
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user