Title: [commits] (heikki) [11117] Follow-up to bug 3658, actually write the WrongHost error message in a way that
Revision
11117
Author
heikki
Date
2006-07-11 09:52:22 -0700 (Tue, 11 Jul 2006)

Log Message

Follow-up to bug 3658, actually write the WrongHost error message in a way that
is translatable.

Modified Paths

Diff

Modified: trunk/chandler/parcels/osaf/mail/base.py (11116 => 11117)

--- trunk/chandler/parcels/osaf/mail/base.py	2006-07-11 03:57:56 UTC (rev 11116)
+++ trunk/chandler/parcels/osaf/mail/base.py	2006-07-11 16:52:22 UTC (rev 11117)
@@ -34,6 +34,7 @@
 import osaf.pim.mail as Mail
 from osaf.framework.certstore import ssl
 import application.Utility as Utility
+from osaf import messages
 
 #Chandler Mail Service imports
 import errors
@@ -338,8 +339,9 @@
             # Post an asynchronous event to the main thread where
             # we ask the user if they would like to continue even though
             # the certificate identifies a different host.
-            displayIgnoreSSLErrorDialog(err.pem, errorText,#XXX intl
-                                              reconnect)
+            displayIgnoreSSLErrorDialog(err.pem,
+                                        messages.SSL_HOST_MISMATCH % {'expectedHost': err.expectedHost, 'actualHost': err.actualHost},
+                                        reconnect)
 
             self._actionCompleted()
             return

Modified: trunk/chandler/parcels/osaf/mail/smtp.py (11116 => 11117)

--- trunk/chandler/parcels/osaf/mail/smtp.py	2006-07-11 03:57:56 UTC (rev 11116)
+++ trunk/chandler/parcels/osaf/mail/smtp.py	2006-07-11 16:52:22 UTC (rev 11117)
@@ -499,9 +499,9 @@
 
             return True
         elif str(err.__class__) == errors.M2CRYPTO_CHECKER_ERROR:
-            #XXX [i18n] this message needs to be localized
-            displayIgnoreSSLErrorDialog(err.pem, str(err),
-                                              reconnect)
+            displayIgnoreSSLErrorDialog(err.pem,
+                                        messages.SSL_HOST_MISMATCH % {'expectedHost': err.expectedHost, 'actualHost': err.actualHost},
+                                        reconnect)
 
             return True
         return False

Modified: trunk/chandler/parcels/osaf/messages.py (11116 => 11117)

--- trunk/chandler/parcels/osaf/messages.py	2006-07-11 03:57:56 UTC (rev 11116)
+++ trunk/chandler/parcels/osaf/messages.py	2006-07-11 16:52:22 UTC (rev 11117)
@@ -55,5 +55,6 @@
 ACCOUNT_PREFERENCES = _(u"Account Preferences")
 ACCOUNT = _(u"%(accountName)s Account")
 
+# SSL
+SSL_HOST_MISMATCH = _(u'Peer certificate does not match host, expected %(expectedHost)s, got %(actualHost)s')
 
-

Modified: trunk/chandler/parcels/osaf/sharing/WebDAV.py (11116 => 11117)

--- trunk/chandler/parcels/osaf/sharing/WebDAV.py	2006-07-11 03:57:56 UTC (rev 11116)
+++ trunk/chandler/parcels/osaf/sharing/WebDAV.py	2006-07-11 16:52:22 UTC (rev 11117)
@@ -37,7 +37,7 @@
 import application.Globals as Globals
 import application.Utility as Utility
 from osaf.framework.certstore import ssl
-                
+from osaf import messages         
 
 class ChandlerServerHandle(zanshin.webdav.ServerHandle):
     def __init__(self, host=None, port=None, username=None, password=None,
@@ -98,7 +98,7 @@
     
                 handler = lambda: ssl.askIgnoreSSLError(
                     err.pem, 
-                    str(err), # XXX intl
+                    messages.SSL_HOST_MISMATCH % {'expectedHost': err.expectedHost, 'actualHost': err.actualHost},
                     retry)
                 self._handleSSLError(handler, err, callable, *args, **keywds)
     




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to