Skip to content

Commit

Permalink
Change default TLS min version to 1.2
Browse files Browse the repository at this point in the history
The current default (before this commit) depends on the Go
version.

This driver has a Go 1.16 baseline, meaning:

 - 1.0 is the platform default min TLS version for Go 1.16 and
   Go 1.17
 - 1.2 for clients in Go 1.18 and Go 1.19

This commit now hardcodes the minimum TLS version to 1.12, as a
better security default.

If users do not specify the minimum TLS version, 1.2 will be set.
  • Loading branch information
fbiville committed Jan 27, 2023
1 parent 07b9555 commit 7a11b08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion neo4j/internal/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ func (c Connector) Connect(address string, boltLogger log.BoltLogger) (db.Connec
conn.Close()
return nil, err
}
config := tls.Config{InsecureSkipVerify: c.SkipVerify, RootCAs: c.RootCAs, ServerName: serverName}
config := tls.Config{
InsecureSkipVerify: c.SkipVerify,
RootCAs: c.RootCAs,
ServerName: serverName,
MinVersion: tls.VersionTLS12,
}
tlsconn := tls.Client(conn, &config)
err = tlsconn.Handshake()
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion testkit-backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@ func (b *backend) handleRequest(req map[string]interface{}) {
"Feature:Bolt:4.4",
"Feature:Bolt:Patch:UTC",
"Feature:Impersonation",
"Feature:TLS:1.1",
"Feature:TLS:1.2",
"Feature:TLS:1.3",
"Optimization:ConnectionReuse",
Expand Down

0 comments on commit 7a11b08

Please sign in to comment.