comparison 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
comparison
equal deleted inserted replaced
29226:33006bd6a1d7 29227:dffe78d80a6c
137 s.ehlo() 137 s.ehlo()
138 s.starttls() 138 s.starttls()
139 s.ehlo() 139 s.ehlo()
140 if (starttls or smtps) and verifycert: 140 if (starttls or smtps) and verifycert:
141 ui.note(_('(verifying remote certificate)\n')) 141 ui.note(_('(verifying remote certificate)\n'))
142 sslutil.validator(ui, mailhost)(s.sock, verifycert == 'strict') 142 sslutil.validatesocket(s.sock, verifycert == 'strict')
143 username = ui.config('smtp', 'username') 143 username = ui.config('smtp', 'username')
144 password = ui.config('smtp', 'password') 144 password = ui.config('smtp', 'password')
145 if username and not password: 145 if username and not password:
146 password = ui.getpass() 146 password = ui.getpass()
147 if username and password: 147 if username and password: