Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientOptions Dialer introduces backward compatibility issue, when used without NewClientOptions() #576

Closed
GilGil1 opened this issue Dec 27, 2021 · 1 comment

Comments

@GilGil1
Copy link
Contributor

GilGil1 commented Dec 27, 2021

Hi, I'm not sure about that issue, yet it caused a working code to panic.
The issue is also ours, as we are setting the ClientOptions without using the NewClientOptions().
Members are public, therefore we are tempted to set those directly.
We didn't initiate the new member dialer, as it was not needed on last release v 1.3.5
The program crashes when trying to dial in file netconn.go:
The change of signature, enables the use of a nil dialer:
was
conn, err := tls.DialWithDialer(&net.Dialer{Timeout: timeout}, "tcp", uri.Host, tlsc)
changed to:
conn, err := tls.DialWithDialer(dialer, "tcp", uri.Host, tlsc)

suggest to add a protection at a line before to catch a nil dialer and replace it by the default one
I can assist with a PR if needed..

@MattBrittan
Copy link
Contributor

Thanks @GilGil1 - as this was a quick fix I have merger PR #577 to resolve the issue.

@GilGil1 GilGil1 closed this as completed Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants