##// END OF EJS Templates
fix smtp with mercurial tip...
Dan Villiom Podlaski Christiansen -
r228:d2baaf23 default
parent child Browse files
Show More
@@ -620,7 +620,9 b' def keyring_supported_smtp(ui, username)'
620 620 raise util.Abort(_('invalid smtp.verifycert configuration: %s')
621 621 % (verifycert))
622 622 verifycert = False
623 if (starttls or smtps) and verifycert:
623 if getattr(sslutil, 'sslkwargs', None) is None:
624 sslkwargs = None
625 elif (starttls or smtps) and verifycert:
624 626 sslkwargs = sslutil.sslkwargs(ui, mailhost)
625 627 else:
626 628 sslkwargs = {}
@@ -628,12 +630,16 b' def keyring_supported_smtp(ui, username)'
628 630 ui.note(_('(using smtps)\n'))
629 631
630 632 # mercurial 3.8 added a mandatory host arg
631 if 'host' in SMTPS.__init__.__code__.co_varnames:
633 if not sslkwargs:
634 s = SMTPS(ui, local_hostname=local_hostname, host=mailhost)
635 elif 'host' in SMTPS.__init__.__code__.co_varnames:
632 636 s = SMTPS(sslkwargs, local_hostname=local_hostname, host=mailhost)
633 637 else:
634 638 s = SMTPS(sslkwargs, local_hostname=local_hostname)
635 639 elif starttls:
636 if 'host' in STARTTLS.__init__.__code__.co_varnames:
640 if not sslkwargs:
641 s = STARTTLS(ui, local_hostname=local_hostname, host=mailhost)
642 elif 'host' in STARTTLS.__init__.__code__.co_varnames:
637 643 s = STARTTLS(sslkwargs, local_hostname=local_hostname, host=mailhost)
638 644 else:
639 645 s = STARTTLS(sslkwargs, local_hostname=local_hostname)
@@ -654,7 +660,10 b' def keyring_supported_smtp(ui, username)'
654 660 s.ehlo()
655 661 if (starttls or smtps) and verifycert:
656 662 ui.note(_('(verifying remote certificate)\n'))
657 sslutil.validator(ui, mailhost)(s.sock, verifycert == 'strict')
663 if getattr(sslutil, 'validatesocket', None):
664 sslutil.validatesocket(s.sock)
665 else:
666 validator(ui, mailhost)(s.sock, verifycert == 'strict')
658 667
659 668 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
660 669 stored = password = password_store.get_smtp_password(
General Comments 0
You need to be logged in to leave comments. Login now