Show More
@@ -620,7 +620,9 b' def keyring_supported_smtp(ui, username)' | |||||
620 | raise util.Abort(_('invalid smtp.verifycert configuration: %s') |
|
620 | raise util.Abort(_('invalid smtp.verifycert configuration: %s') | |
621 | % (verifycert)) |
|
621 | % (verifycert)) | |
622 | verifycert = False |
|
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 | sslkwargs = sslutil.sslkwargs(ui, mailhost) |
|
626 | sslkwargs = sslutil.sslkwargs(ui, mailhost) | |
625 | else: |
|
627 | else: | |
626 | sslkwargs = {} |
|
628 | sslkwargs = {} | |
@@ -628,12 +630,16 b' def keyring_supported_smtp(ui, username)' | |||||
628 | ui.note(_('(using smtps)\n')) |
|
630 | ui.note(_('(using smtps)\n')) | |
629 |
|
631 | |||
630 | # mercurial 3.8 added a mandatory host arg |
|
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 | s = SMTPS(sslkwargs, local_hostname=local_hostname, host=mailhost) |
|
636 | s = SMTPS(sslkwargs, local_hostname=local_hostname, host=mailhost) | |
633 | else: |
|
637 | else: | |
634 | s = SMTPS(sslkwargs, local_hostname=local_hostname) |
|
638 | s = SMTPS(sslkwargs, local_hostname=local_hostname) | |
635 | elif starttls: |
|
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 | s = STARTTLS(sslkwargs, local_hostname=local_hostname, host=mailhost) |
|
643 | s = STARTTLS(sslkwargs, local_hostname=local_hostname, host=mailhost) | |
638 | else: |
|
644 | else: | |
639 | s = STARTTLS(sslkwargs, local_hostname=local_hostname) |
|
645 | s = STARTTLS(sslkwargs, local_hostname=local_hostname) | |
@@ -654,7 +660,10 b' def keyring_supported_smtp(ui, username)' | |||||
654 | s.ehlo() |
|
660 | s.ehlo() | |
655 | if (starttls or smtps) and verifycert: |
|
661 | if (starttls or smtps) and verifycert: | |
656 | ui.note(_('(verifying remote certificate)\n')) |
|
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 | stored = password = password_store.get_smtp_password( |
|
669 | stored = password = password_store.get_smtp_password( |
General Comments 0
You need to be logged in to leave comments.
Login now