Changeset 9886
- Timestamp:
- 07/05/08 20:07:32 (5 months ago)
- Location:
- trunk/src
- Files:
-
- 4 modified
-
common/config.py (modified) (1 diff)
-
common/connection.py (modified) (1 diff)
-
config.py (modified) (2 diffs)
-
gajim.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/config.py
r9815 r9886 278 278 'keyname': [ opt_str, '', '', True ], 279 279 'connection_types': [ opt_str, 'tls ssl plain', _('Ordered list (space separated) of connection type to try. Can contain tls, ssl or plain')], 280 'warn_when_insecure_connection': [ opt_bool, True, _('Show a warning dialog before sending password on an insecure connection.') ], 280 'warn_when_plaintext_connection': [ opt_bool, True, _('Show a warning dialog before sending password on an plaintext connection.') ], 281 'warn_when_insecure_ssl_connection': [ opt_bool, True, _('Show a warning dialog before using standard SSL library.') ], 281 282 'ssl_fingerprint_sha1': [ opt_str, '', '', True ], 282 283 'ignore_ssl_errors': [ opt_str, '', _('Space separated list of ssl errors to ignore.') ], -
trunk/src/common/connection.py
r9876 r9886 615 615 return 616 616 if _con_type == 'plain' and gajim.config.get_per('accounts', self.name, 617 'warn_when_ insecure_connection'):617 'warn_when_plaintext_connection'): 618 618 self.dispatch('PLAIN_CONNECTION', (con,)) 619 return True 620 if _con_type in ('tls', 'ssl') and not hasattr(con.Connection, 621 '_sslcontext') and gajim.config.get_per('accounts', self.name, 622 'warn_when_insecure_ssl_connection'): 623 # Pyopenssl is not used 624 self.dispatch('INSECURE_SSL_CONNECTION', (con, _con_type)) 619 625 return True 620 626 return self.connection_accepted(con, con_type) -
trunk/src/config.py
r9744 r9886 1567 1567 self.xml.get_widget('proxy_hbox1').set_sensitive(not use_env_http_proxy) 1568 1568 1569 warn_when_insecure = gajim.config.get_per('accounts', account,1570 'warn_when_insecure_ connection')1569 warn_when_insecure_ssl = gajim.config.get_per('accounts', account, 1570 'warn_when_insecure_ssl_connection') 1571 1571 self.xml.get_widget('warn_when_insecure_connection_checkbutton1').\ 1572 set_active(warn_when_insecure )1572 set_active(warn_when_insecure_ssl) 1573 1573 1574 1574 self.xml.get_widget('send_keepalive_checkbutton1').set_active( … … 1940 1940 return 1941 1941 1942 self.on_checkbutton_toggled(widget, 'warn_when_insecure_ connection',1942 self.on_checkbutton_toggled(widget, 'warn_when_insecure_ssl_connection', 1943 1943 account=self.current_account) 1944 1944 -
trunk/src/gajim.py
r9880 r9886 1934 1934 # ('PLAIN_CONNECTION', account, (connection)) 1935 1935 server = gajim.config.get_per('accounts', account, 'hostname') 1936 def on_yes(is_checked): 1937 if is_checked: 1936 def on_ok(is_checked): 1937 if not is_checked[0]: 1938 on_cancel() 1939 return 1940 if is_checked[1]: 1938 1941 gajim.config.set_per('accounts', account, 1939 'warn_when_ insecure_connection', False)1942 'warn_when_plaintext_connection', False) 1940 1943 gajim.connections[account].connection_accepted(data[0], 'tcp') 1941 def on_no(): 1944 def on_cancel(): 1945 gajim.connections[account].disconnect(on_purpose=True) 1946 self.handle_event_status(account, 'offline') 1947 pritext = _('Insecure connection') 1948 sectext = _('You are about to send your password on an unencrypted ' 1949 'connection. Are you sure you want to do that?') 1950 checktext1 = _('Yes, I really want to connect insecurely') 1951 checktext2 = _('Do _not ask me again') 1952 dialog = dialogs.ConfirmationDialogDubbleCheck(pritext, sectext, 1953 checktext1, checktext2, on_response_ok=on_ok, 1954 on_response_cancel=on_cancel, is_modal=False) 1955 1956 def handle_event_insecure_ssl_connection(self, account, data): 1957 # ('INSECURE_SSL_CONNECTION', account, (connection, connection_type)) 1958 server = gajim.config.get_per('accounts', account, 'hostname') 1959 def on_ok(is_checked): 1960 if not is_checked[0]: 1961 on_cancel() 1962 return 1963 if is_checked[1]: 1964 gajim.config.set_per('accounts', account, 1965 'warn_when_insecure_ssl_connection', False) 1966 gajim.connections[account].connection_accepted(data[0], data[1]) 1967 def on_cancel(): 1942 1968 gajim.connections[account].disconnect(on_purpose=True) 1943 1969 self.handle_event_status(account, 'offline') 1944 1970 pritext = _('Insecure connection') 1945 1971 sectext = _('You are about to send your password on an insecure ' 1946 'connection. Are you sure you want to do that?') 1947 checktext = _('Do _not ask me again') 1948 dialog = dialogs.YesNoDialog(pritext, sectext, checktext, 1949 on_response_yes=on_yes, on_response_no=on_no) 1972 'connection. You should install PyOpenSSL to prevent that. Are you sure you want to do that?') 1973 checktext1 = _('Yes, I really want to connect insecurely') 1974 checktext2 = _('Do _not ask me again') 1975 dialog = dialogs.ConfirmationDialogDubbleCheck(pritext, sectext, 1976 checktext1, checktext2, on_response_ok=on_ok, 1977 on_response_cancel=on_cancel, is_modal=False) 1950 1978 1951 1979 def handle_event_pubsub_node_removed(self, account, data): … … 2038 2066 'FINGERPRINT_ERROR': self.handle_event_fingerprint_error, 2039 2067 'PLAIN_CONNECTION': self.handle_event_plain_connection, 2068 'INSECURE_SSL_CONNECTION': self.handle_event_insecure_ssl_connection, 2040 2069 'PUBSUB_NODE_REMOVED': self.handle_event_pubsub_node_removed, 2041 2070 'PUBSUB_NODE_NOT_REMOVED': self.handle_event_pubsub_node_not_removed,
