-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Not Needed
For connections that require TLS, the driver asynchronously performs the TLS handshake in a goroutine here. The main goroutine waits for either the handshake to complete or the context to expire. In the latter case, the driver just stops waiting for the goroutine here and returns "ctx.Err()".
This is undesirable because it assumes that Handshake() will eventually return, which could be considered a goroutine leak. It also results in an error like "context deadline exceeded" being propagated to the application with no other information. We should consider using the new "tls.Conn#HandshakeContext" function when the application is using Go 1.17+.