Menu

#41 TLS (SSL) client loops before SSL becomes ready

open
nobody
None
8
2015-02-02
2009-05-04
Pat Thoyts
No

Mis-raised as a Tcl bug by an anonymous poster this is a TLS issue. I see this with tkchat when the local proxy goes down. On attempting to reconnect tkchat will go to 100% cpu usage for a while until it decides there is no route.

A non-blocking client socket is in a active wait (spending 100% of the CPU)
state if he tries to write before the SSL is ready (detected using the
SSL_is_finished function). This doesn't happen in the non-blocking
version.

It was detected using the test/simpleClient.tcl script available from the
TLS extension, and using any SSL server from the Internet (the slower the
server responds to the SSL handshake the worser).

If compiling the TLS in debug we get the following message repeated:

BIO_write(0x27a448, 16)
WaitForConnect(0x27a448)
BioRead(0x48fc20, <buf>, 7) [0x27a048]
[0x27a048] BioRead(7) -> -1 [0.11]
ERR(5, 11)
Output(16) -> -1

After writing to the socket once, the TlsOutputProc (the TLS output
callback) keeps getting called in a cycle wasting 100% of CPU, until the
SSL_is_init_finished function returns 1.

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.