comparison mercurial/mail.py @ 23223:a4af6fd99fb0 stable

mail: actually use the verifycert config value The mail module only verifies the smtp ssl certificate if 'verifycert' is enabled (the default). The 'verifycert' can take three possible values: - 'strict' - 'loose' - any "False" value, eg: 'false' or '0' We tested the validity of the third value, but never converted it to actual falseness, making 'False' an equivalent for 'loose'. This changeset fixes it.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 05 Nov 2014 18:31:39 +0000
parents c80feeb715d1
children ff2ec757aacb
comparison
equal deleted inserted replaced
23206:a7f25a31e021 23223:a4af6fd99fb0
102 verifycert = ui.config('smtp', 'verifycert', 'strict') 102 verifycert = ui.config('smtp', 'verifycert', 'strict')
103 if verifycert not in ['strict', 'loose']: 103 if verifycert not in ['strict', 'loose']:
104 if util.parsebool(verifycert) is not False: 104 if util.parsebool(verifycert) is not False:
105 raise util.Abort(_('invalid smtp.verifycert configuration: %s') 105 raise util.Abort(_('invalid smtp.verifycert configuration: %s')
106 % (verifycert)) 106 % (verifycert))
107 verifycert = False
107 if (starttls or smtps) and verifycert: 108 if (starttls or smtps) and verifycert:
108 sslkwargs = sslutil.sslkwargs(ui, mailhost) 109 sslkwargs = sslutil.sslkwargs(ui, mailhost)
109 else: 110 else:
110 sslkwargs = {} 111 sslkwargs = {}
111 if smtps: 112 if smtps: