TCPSocket reports incorrect TCPReadyState causing misleading logs and harm to SMTP
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: maxe, Assigned: jesup)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged][necko-priority-queue])
Attachments
(1 external file)
To remind everything, these are the available options:
enum TCPReadyState {
"connecting",
"open",
"closing",
"closed",
};
I noticed two correctness issues with this.
A:
State: Connecting during proxy lookup AsyncResolve
Expected result: connecting
Actual result: closed
B:
State: Connecting to SSL/TLS using useSecureTransport: true, TCP established, TLS still in flight
Expected result: connecting
Actual result: open
I would like to see them fixed in one go, B is much more severe than A because an open TCP session can easily happen with some kind of middlebox or incorrect server before TLS is established.
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 1•2 months ago
|
||
Two correctness issues:
- readyState stayed "closed" instead of "connecting" while the proxy
lookup for a new connection was in flight, because ResolveProxy() left
mReadyState at its constructor default until the async lookup completed. - With useSecureTransport, readyState jumped to "open" (and the "open"
event fired) as soon as the TCP handshake completed, even though the TLS
handshake was still in progress. An open TCP session before TLS is
established can happen with a misbehaving middlebox or server, so this
is the more severe of the two.
Set mReadyState at the start of ResolveProxy(), and for secure sockets
defer the transition to "open" from STATUS_CONNECTED_TO to
HandshakeDone(), reported via nsITlsHandshakeCallbackListener.
Comment 2•26 days ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 1 week.
:jesup, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
Comment 4•15 days ago
|
||
| bugherder | ||
Updated•14 days ago
|
Description
•