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

add InsecureSkipServerNameVerify to tls.Config #158

Merged
merged 2 commits into from
Feb 4, 2023
Merged

add InsecureSkipServerNameVerify to tls.Config #158

merged 2 commits into from
Feb 4, 2023

Conversation

TNQOYxNU
Copy link
Contributor

@TNQOYxNU TNQOYxNU commented Feb 4, 2023

No description provided.


// [UTLS SECTION START]
skipServerNameVerify := config.InsecureSkipVerify || config.InsecureSkipServerNameVerify
if len(config.ServerName) == 0 && !skipServerNameVerify {
return nil, nil, errors.New("tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also update the error message to reflect your changes made to Config

u_conn.go Outdated
@@ -377,7 +377,8 @@ func (c *UConn) clientHandshake(ctx context.Context) (err error) {
// [uTLS section begins]
// don't make new ClientHello, use hs.hello
// preserve the checks from beginning and end of makeClientHello()
if len(c.config.ServerName) == 0 && !c.config.InsecureSkipVerify {
skipServerNameVerify := c.config.InsecureSkipVerify || c.config.InsecureSkipServerNameVerify
if len(c.config.ServerName) == 0 && !skipServerNameVerify {
return errors.New("tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line as well

@gaukas
Copy link
Member

gaukas commented Feb 4, 2023

Also go test has failed. Please fix referring to the error message below:

=== RUN   TestCloneNonFuncFields
    tls_test.go:834: all fields must be accounted for, but saw unknown field "InsecureSkipServerNameVerify"

@gaukas
Copy link
Member

gaukas commented Feb 4, 2023

Thanks! I will now get this merged.

@gaukas gaukas merged commit d139a4a into refraction-networking:master Feb 4, 2023
@RPRX
Copy link
Contributor

RPRX commented Feb 5, 2023

Nice work! But it would be better that if we can indicate another ServerName to verify, see #161

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.

None yet

3 participants