From f9f341f104a5fb8dd04062db42de50ec760a104f Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 30 May 2005 11:01:08 +0000 Subject: [PATCH] we can now use SSL (we can't force to not use TLS: bug in xmpp) --- src/common/config.py | 2 +- src/common/connection.py | 7 +++++-- src/config.py | 6 +++--- src/gtkgui.glade | 9 +++++---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/common/config.py b/src/common/config.py index 3a7982a00..b6e262245 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -117,7 +117,7 @@ class Config: 'proxypass': [ opt_str, '' ], 'keyid': [ opt_str, '' ], 'keyname': [ opt_str, '' ], - 'usetls': [ opt_bool, False ], + 'usessl': [ opt_bool, False ], 'force_nonSASL': [ opt_bool, False ], 'savegpgpass': [ opt_bool, False ], 'gpgpassword': [ opt_str, '' ], diff --git a/src/common/connection.py b/src/common/connection.py index 949ad5b0f..92b8ff084 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -519,7 +519,7 @@ class Connection: name = gajim.config.get_per('accounts', self.name, 'name') hostname = gajim.config.get_per('accounts', self.name, 'hostname') resource = gajim.config.get_per('accounts', self.name, 'resource') - usetls = gajim.config.get_per('accounts', self.name, 'usetls') + usessl = gajim.config.get_per('accounts', self.name, 'usessl') #create connection if it doesn't already exist if self.connection: @@ -545,7 +545,10 @@ class Connection: common.xmpp.dispatcher.DefaultTimeout = 45 con.UnregisterDisconnectHandler(con.DisconnectHandler) con.RegisterDisconnectHandler(self._disconnectedCB) - con_type = con.connect((hostname,5222), proxy=proxy, tls=usetls) #FIXME: blocking + port = 5222 + if usessl: + port = 5223 + con_type = con.connect((hostname, port), proxy = proxy) #FIXME: blocking if not con_type: gajim.log.debug("Couldn't connect to %s" % name) self.connected = 0 diff --git a/src/config.py b/src/config.py index 95d073de5..e119210a0 100644 --- a/src/config.py +++ b/src/config.py @@ -1083,8 +1083,8 @@ class Account_modification_window: entry.set_text(gajim.config.get_per('accounts', self.account, 'proxypass')) - usetls = gajim.config.get_per('accounts', self.account, 'usetls') - self.xml.get_widget('use_tls_checkbutton').set_active(usetls) + usessl = gajim.config.get_per('accounts', self.account, 'usessl') + self.xml.get_widget('use_ssl_checkbutton').set_active(usessl) gpg_key_label = self.xml.get_widget('gpg_key_label') if gajim.config.get('usegpg'): @@ -1168,7 +1168,7 @@ class Account_modification_window: dialogs.Error_dialog(_('You must enter a proxy host to use proxy')) return - config['usetls'] = self.xml.get_widget('use_tls_checkbutton').get_active() + config['usessl'] = self.xml.get_widget('use_ssl_checkbutton').get_active() (config['name'], config['hostname']) = jid.split('@') config['keyname'] = self.xml.get_widget('gpg_name_label').get_text() if config['keyname'] == '': #no key selected diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 40f2a4a3f..48f981752 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -1029,7 +1029,7 @@ 0 - + True 0 0.5 @@ -1048,10 +1048,11 @@ 0 - + True + Check this so Gajim will connect in port 5223 where legacy servers are expected to have SSL capabilities. Note that Gajim use TLS encryption by default if broadcasted by the server, and with this option on you disable TLS True - Use _TLS + Use _SSL True GTK_RELIEF_NORMAL True @@ -1066,7 +1067,7 @@ True - <b>TLS</b> + <b>SSL</b> False True GTK_JUSTIFY_LEFT