SSL_accept blocks other SSL connections
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DC++ |
Fix Released
|
Medium
|
Unassigned |
Bug Description
This bug appears when TLS encryption is enabled in ADC hub and it is easily reproducable when trying to connect to more users in hub (I'm trying to connect to all users in DCDev Public).
When TLS is on, there is a lot of users I can't connect to. The reason is that SSL_connect is waiting too long and connection timeouts during that time and is disconnected.
I have no solution for this problem, but I think it's caused by SSL_accept which is blocking operation and if it block for some time, it will block all other connections. It's only my guess, because if I put setBlocking(false) before SSL_accept (and setBlocking(true) after it), the problem disappears and I can connect to all users then. But in this case I get debug message "Connected to SSL client using (NONE)", so I'm not sure if it correct way (because normally it writes some type of encryption instead of NONE), so it would be good to find some better fix.
Maybe proper solution would be make some threadAccept (like threadConnect) in BufferedSocket.
Changed in dcplusplus: | |
importance: | Undecided → Medium |
status: | New → Fix Committed |
Changed in dcplusplus: | |
status: | Fix Committed → In Progress |
Changed in dcplusplus: | |
status: | Fix Committed → Fix Released |
Also, it is connected with bug that when one side is waiting in SSL_connect and second side retry the connection, it will create new connection which will wait in SSL_connect again and this can repeat forever.