Mercurial > public > mercurial-scm > hg-stable
diff mercurial/mail.py @ 29227:dffe78d80a6c
sslutil: convert socket validation from a class to a function (API)
Now that the socket validator doesn't have any instance state,
we can make it a generic function.
The "validator" class has been converted into the "validatesocket"
function and all consumers have been updated.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 15 May 2016 11:38:38 -0700 |
parents | bac14dbbbfab |
children | e6de6ef3e426 |
line wrap: on
line diff
--- a/mercurial/mail.py Sun May 15 11:32:11 2016 -0700 +++ b/mercurial/mail.py Sun May 15 11:38:38 2016 -0700 @@ -139,7 +139,7 @@ s.ehlo() if (starttls or smtps) and verifycert: ui.note(_('(verifying remote certificate)\n')) - sslutil.validator(ui, mailhost)(s.sock, verifycert == 'strict') + sslutil.validatesocket(s.sock, verifycert == 'strict') username = ui.config('smtp', 'username') password = ui.config('smtp', 'password') if username and not password: