fix registering new account
This commit is contained in:
parent
33eeadcf5f
commit
9698251570
|
@ -1562,17 +1562,18 @@ class NewAccountConnectedEvent(nec.NetworkIncomingEvent):
|
||||||
try:
|
try:
|
||||||
self.errnum = self.conn.connection.Connection.ssl_errnum
|
self.errnum = self.conn.connection.Connection.ssl_errnum
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.errnum = -1 # we don't have an errnum
|
self.errnum = [] # we don't have an errnum
|
||||||
self.ssl_msg = ''
|
self.ssl_msg = ''
|
||||||
if self.errnum > 0:
|
for er in self.errnum:
|
||||||
from common.connection import ssl_error
|
if er > 0:
|
||||||
self.ssl_msg = ssl_error.get(self.errnum, _(
|
from common.connection import ssl_error
|
||||||
'Unknown SSL error: %d') % self.errnum)
|
self.ssl_msg = ssl_error.get(er, _('Unknown SSL error: %d') % \
|
||||||
|
er)
|
||||||
self.ssl_cert = ''
|
self.ssl_cert = ''
|
||||||
if hasattr(self.conn.connection.Connection, 'ssl_cert_pem'):
|
if len(self.conn.connection.Connection.ssl_cert_pem):
|
||||||
self.ssl_cert = self.conn.connection.Connection.ssl_cert_pem
|
self.ssl_cert = self.conn.connection.Connection.ssl_cert_pem
|
||||||
self.ssl_fingerprint = ''
|
self.ssl_fingerprint = ''
|
||||||
if hasattr(self.conn.connection.Connection, 'ssl_fingerprint_sha1'):
|
if len(self.conn.connection.Connection.ssl_fingerprint_sha1):
|
||||||
self.ssl_fingerprint = \
|
self.ssl_fingerprint = \
|
||||||
self.conn.connection.Connection.ssl_fingerprint_sha1
|
self.conn.connection.Connection.ssl_fingerprint_sha1
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue