Commit 2b65c5d5 authored by Yann Leboulanger's avatar Yann Leboulanger

ability to see certificate on ssl error dialog. Fixes #3998

parent 34248839
......@@ -1273,7 +1273,8 @@ def connection_accepted(self, con, con_type):
gajim.nec.push_incoming_event(SSLErrorEvent(None, conn=self,
error_text=text, error_num=errnum,
cert=con.Connection.ssl_cert_pem,
fingerprint=con.Connection.ssl_fingerprint_sha1))
fingerprint=con.Connection.ssl_fingerprint_sha1,
certificate=con.Connection.ssl_certificate))
return True
if hasattr(con.Connection, 'ssl_fingerprint_sha1'):
saved_fingerprint = gajim.config.get_per('accounts', self.name, 'ssl_fingerprint_sha1')
......
......@@ -5646,7 +5646,24 @@ def __init__(self, pritext='', sectext='', checktext='',
self.cert = certificate
YesNoDialog.__init__(self, pritext, sectext, checktext, on_response_yes,
on_response_no)
b = gtk.Button('View cert...')
b = gtk.Button(_('View cert...'))
b.connect('clicked', self.on_cert_clicked)
b.show_all()
area = self.get_action_area()
area.pack_start(b)
def on_cert_clicked(self, button):
d = CertificatDialog(self, self.account, self.cert)
class SSLErrorDialog(ConfirmationDialogDoubleCheck):
def __init__(self, account, certificate, pritext, sectext, checktext1,
checktext2, on_response_ok=None, on_response_cancel=None):
self.account = account
self.cert = certificate
ConfirmationDialogDoubleCheck.__init__(self, pritext, sectext,
checktext1, checktext2, on_response_ok, on_response_cancel,
is_modal=False)
b = gtk.Button(_('View cert...'))
b.connect('clicked', self.on_cert_clicked)
b.show_all()
area = self.get_action_area()
......
......@@ -1219,8 +1219,9 @@ def on_cancel():
if 'ssl_error' in self.instances[account]['online_dialog']:
self.instances[account]['online_dialog']['ssl_error'].destroy()
self.instances[account]['online_dialog']['ssl_error'] = \
dialogs.ConfirmationDialogDoubleCheck(pritext, sectext, checktext1,
checktext2, on_response_ok=on_ok, on_response_cancel=on_cancel)
dialogs.SSLErrorDialog(obj.conn.name, obj.certificate, pritext,
sectext, checktext1, checktext2, on_response_ok=on_ok,
on_response_cancel=on_cancel)
def handle_event_fingerprint_error(self, obj):
# ('FINGERPRINT_ERROR', account, (new_fingerprint,))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment