Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gajim
python-nbxmpp
Commits
75d81bdd
Commit
75d81bdd
authored
Nov 29, 2012
by
Yann Leboulanger
Browse files
do TLS handshake without blocking.
parent
c04b5fbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
nbxmpp/tls_nb.py
View file @
75d81bdd
...
...
@@ -418,13 +418,13 @@ class NonBlockingTLS(PlugIn):
tcpsock
.
_send
=
wrapper
.
send
log
.
debug
(
"Initiating handshake..."
)
tcpsock
.
_sslObj
.
setblocking
(
True
)
try
:
tcpsock
.
_sslObj
.
do_handshake
()
except
(
OpenSSL
.
SSL
.
WantReadError
,
OpenSSL
.
SSL
.
WantWriteError
),
e
:
pass
except
:
log
.
error
(
'Error while TLS handshake: '
,
exc_info
=
True
)
return
False
tcpsock
.
_sslObj
.
setblocking
(
False
)
self
.
_owner
.
ssl_lib
=
PYOPENSSL
return
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment