QSslSocket delay after IPv6 sends TCP reset
-
Kristall's gemini handler uses Qt's QSslSocket to communicate in TCP. When
socket.connectToHostEncrypted(...)
is called, both an IPv4A
DNS query and an IPv6AAAA
DNS query are issued. If both an IPv4 address and an IPv6 address are returned, theQSslSocket
first attempts to connect to the server by sending a TCP packet with the SYN flag set. Ordinarily, the server responds with a TCP packet with the SYN and ACK flags set, and the connection is considered open for the rest of the request to complete.For certain hosts, the server instead responds over IPv6 with a packet that has the RST reset flag set indicating that the client should terminate the connection attempt. The
QSslSocket
then waits 30 seconds before retrying with the IPv4 address. Is there a way to remove this delay and immediately fall back to IPv4 if the server refuses IPv6? -
Hi and welcome to devnet,
Which version of Qt are you using ?
On what OS ? -
Hello! I'm using Qt 5.15.0 on macOS 10.14.6.