core (xmpp): server certificate validation:

XMPP server certificate is now checked, and connection is refused (by default) if it's not valid.
Certificate check can be disabled in the new parameter "Configuration/check_certificate".
If certificate checking is disabled, a warning note is sent on every new connection.
Twisted and Wokkel are temporarly monkey patched in sat.core.tls_patches module, until modifications are merged upstream.
This commit is contained in:
Goffi 2018-11-10 10:16:35 +01:00
commit 1b8345f4af

View file

@ -75,23 +75,25 @@ class Params(object):
<param name="%(force_port_param)s" value="" type="int" constraint="1;65535" security="50" />
<param name="autoconnect" label="%(autoconnect_label)s" value="true" type="bool" security="50" />
<param name="autodisconnect" label="%(autodisconnect_label)s" value="false" type="bool" security="50" />
<param name="check_certificate" label="%(check_certificate_label)s" value="true" type="bool" security="4" />
</category>
</individual>
</params>
""" % {
"category_general": D_("General"),
"category_connection": D_("Connection"),
"history_param": C.HISTORY_LIMIT,
"history_label": D_("Chat history limit"),
"show_offline_contacts": C.SHOW_OFFLINE_CONTACTS,
"show_offline_contacts_label": D_("Show offline contacts"),
"show_empty_groups": C.SHOW_EMPTY_GROUPS,
"show_empty_groups_label": D_("Show empty groups"),
"force_server_param": C.FORCE_SERVER_PARAM,
"force_port_param": C.FORCE_PORT_PARAM,
"new_account_label": D_("Register new account"),
"autoconnect_label": D_("Connect on frontend startup"),
"autodisconnect_label": D_("Disconnect on frontend closure"),
u"category_general": D_(u"General"),
u"category_connection": D_(u"Connection"),
u"history_param": C.HISTORY_LIMIT,
u"history_label": D_(u"Chat history limit"),
u"show_offline_contacts": C.SHOW_OFFLINE_CONTACTS,
u"show_offline_contacts_label": D_(u"Show offline contacts"),
u"show_empty_groups": C.SHOW_EMPTY_GROUPS,
u"show_empty_groups_label": D_(u"Show empty groups"),
u"force_server_param": C.FORCE_SERVER_PARAM,
u"force_port_param": C.FORCE_PORT_PARAM,
u"new_account_label": D_(u"Register new account"),
u"autoconnect_label": D_(u"Connect on frontend startup"),
u"autodisconnect_label": D_(u"Disconnect on frontend closure"),
u"check_certificate_label": D_(u"Check certificate (don't uncheck if unsure)"),
}
def load_default_params(self):