Skip to content

Commit

Permalink
Move doHandshake to client.go
Browse files Browse the repository at this point in the history
The doHandshake function was split off to separate files to support
different implementations for Go < 1.16 and Go >= 1.17.

The separate files are not needed now that Go 1.20 is the minimum
supported version of Go for the project.
  • Loading branch information
tebuka authored and jaitaiwan committed Jul 2, 2024
1 parent 8915bad commit 682b25f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 42 deletions.
12 changes: 12 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,15 @@ func cloneTLSConfig(cfg *tls.Config) *tls.Config {
}
return cfg.Clone()
}

func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error {
if err := tlsConn.HandshakeContext(ctx); err != nil {
return err
}
if !cfg.InsecureSkipVerify {
if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil {
return err
}
}
return nil
}
21 changes: 0 additions & 21 deletions tls_handshake.go

This file was deleted.

21 changes: 0 additions & 21 deletions tls_handshake_116.go

This file was deleted.

0 comments on commit 682b25f

Please # to comment.