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

fix: use passthrough resolver for server address #75

Closed
wants to merge 1 commit into from

Conversation

NewbieOrange
Copy link
Contributor

https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md

NewClient use dns resolver by default instead of DialContext using passthrough. This seem to broke compatibility with TLS server when the domain resolves to an IPv6 address.

@naiba
Copy link
Member

naiba commented Oct 19, 2024

没懂

@NewbieOrange
Copy link
Contributor Author

没懂

NewClient默认使用dns resolver会先解析域名成IP再访问,而不是像原本DialContext那样直接使用域名访问。这个不知道为什么会导致开启TLS+服务器域名解析到IPv6时访问超时(现象如 #74 下面评论的;另,如果不开启TLS或者域名不解析到IPv6的话好像就正常)。

这里改为使用passthrough resolver解析,对齐之前DialContext的逻辑之后就修复了。

@naiba
Copy link
Member

naiba commented Oct 19, 2024

没懂

NewClient默认使用dns resolver会先解析域名成IP再访问,而不是像原本DialContext那样直接使用域名访问。这个不知道为什么会导致开启TLS+服务器域名解析到IPv6时访问超时(现象如 #74 下面评论的;另,如果不开启TLS或者域名不解析到IPv6的话好像就正常)。

这里改为使用passthrough resolver解析,对齐之前DialContext的逻辑之后就修复了。

默认就是 passthrough 呀

@naiba naiba closed this in 765f7d9 Oct 19, 2024
@NewbieOrange NewbieOrange deleted the NewbieOrange-patch-1 branch October 19, 2024 08:23
@NewbieOrange
Copy link
Contributor Author

NewbieOrange commented Oct 19, 2024

看到已经修改了,没问题了 😃

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

Successfully merging this pull request may close these issues.

2 participants