diff --git a/src/common/connection.py b/src/common/connection.py
index fc4adc45c4caf01ea83257725aa8ffe5bb117467..f404528439a2e23f7722bd5d72525b5c37d5e5ee 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -1383,8 +1383,7 @@ class Connection(CommonConnection, ConnectionHandlers):
             errnum = con.Connection.ssl_errnum
         except AttributeError:
             errnum = [] # we don't have an errnum
-        i = 0
-        for er in errnum:
+        for i, er in enumerate(errnum):
             if er > 0 and str(er) not in gajim.config.get_per('accounts',
             self.name, 'ignore_ssl_errors').split():
                 text = _('The authenticity of the %s certificate could be '