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

Adding Client TLS1.0 #38

Merged
merged 1 commit into from Jun 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions fastdialer/dialer.go
Expand Up @@ -6,6 +6,7 @@ import (
"crypto/tls"
"encoding/json"
"fmt"
"log"
"net"
"strings"

Expand Down Expand Up @@ -104,10 +105,10 @@ func (d *Dialer) Dial(ctx context.Context, network, address string) (conn net.Co
// DialTLS with encrypted connection
func (d *Dialer) DialTLS(ctx context.Context, network, address string) (conn net.Conn, err error) {
if d.options.WithZTLS {
return d.DialZTLSWithConfig(ctx, network, address, &ztls.Config{InsecureSkipVerify: true})
return d.DialZTLSWithConfig(ctx, network, address, &ztls.Config{InsecureSkipVerify: true, MinVersion: tls.VersionTLS10})
}

return d.DialTLSWithConfig(ctx, network, address, &tls.Config{InsecureSkipVerify: true})
return d.DialTLSWithConfig(ctx, network, address, &tls.Config{InsecureSkipVerify: true, MinVersion: tls.VersionTLS10})

Check failure

Code scanning / CodeQL

Disabled TLS certificate check

InsecureSkipVerify should not be used in production code.

Check failure

Code scanning / CodeQL

Insecure TLS configuration

Using insecure TLS version VersionTLS10 for MinVersion.
}

// DialZTLS with encrypted connection using ztls
Expand Down Expand Up @@ -202,7 +203,9 @@ func (d *Dialer) dial(ctx context.Context, network, address string, shouldUseTLS
}
hostPort := net.JoinHostPort(ip, port)
if shouldUseTLS {
log.Println(tlsconfig.MinVersion)
tlsconfigCopy := tlsconfig.Clone()
log.Println(tlsconfigCopy.MinVersion)
switch {
case d.options.SNIName != "":
tlsconfigCopy.ServerName = d.options.SNIName
Expand Down