Skip to content

Commit

Permalink
rpcclient: Explicitly require TLS >= 1.2 for HTTP.
Browse files Browse the repository at this point in the history
This set the TLS config to explicitly require TLS 1.2 as the minimum
version for HTTP connections to explicitly match the requirement it
imposes for WebSocket connections.

This is technically a noop for the more recent Go releases that are
officially supported since TLS 1.2 is the default minimum when acting as
a client for those releases, however, it is preferable to be explicit
and consistent.
  • Loading branch information
davecgh committed Jul 26, 2023
1 parent 11ff764 commit 7f430e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rpcclient/infrastructure.go
Expand Up @@ -1187,7 +1187,8 @@ func newHTTPClient(config *ConnConfig) (*http.Client, error) {
pool := x509.NewCertPool()
pool.AppendCertsFromPEM(config.Certificates)
tlsConfig = &tls.Config{
RootCAs: pool,
RootCAs: pool,
MinVersion: tls.VersionTLS12,
}
}
}
Expand Down

0 comments on commit 7f430e7

Please sign in to comment.