mirror of https://github.com/jackc/pgx.git
tls: stop sending ssl_renegotiation_limit in startup message
This addresses https://github.com/jackc/pgx/issues/321 with the
fix @jackc proposed there. Redshift users that need to connect
w/ SSL currently fork the library to delete this parameter, e.g.
8e0028d742
And, that's annoying to keep up-to-date :)
pull/476/head
parent
381a1e8156
commit
e2010c858c
8
conn.go
8
conn.go
|
@ -337,14 +337,6 @@ func (c *Conn) connect(config ConnConfig, network, address string, tlsConfig *tl
|
||||||
Parameters: make(map[string]string),
|
Parameters: make(map[string]string),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default to disabling TLS renegotiation.
|
|
||||||
//
|
|
||||||
// Go does not support (https://github.com/golang/go/issues/5742)
|
|
||||||
// PostgreSQL recommends disabling (http://www.postgresql.org/docs/9.4/static/runtime-config-connection.html#GUC-SSL-RENEGOTIATION-LIMIT)
|
|
||||||
if tlsConfig != nil {
|
|
||||||
startupMsg.Parameters["ssl_renegotiation_limit"] = "0"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy default run-time params
|
// Copy default run-time params
|
||||||
for k, v := range config.RuntimeParams {
|
for k, v := range config.RuntimeParams {
|
||||||
startupMsg.Parameters[k] = v
|
startupMsg.Parameters[k] = v
|
||||||
|
|
7
doc.go
7
doc.go
|
@ -236,6 +236,13 @@ nil, then TLS will be disabled. If it is present, then it will be used to
|
||||||
configure the TLS connection. This allows total configuration of the TLS
|
configure the TLS connection. This allows total configuration of the TLS
|
||||||
connection.
|
connection.
|
||||||
|
|
||||||
|
pgx has never explicitly supported Postgres < 9.6's `ssl_renegotiation` option.
|
||||||
|
As of v3.3.0, it doesn't send `ssl_renegotiation: 0` either to support Redshift
|
||||||
|
(https://github.com/jackc/pgx/pull/476). If you need TLS Renegotiation,
|
||||||
|
consider supplying `ConnConfig.TLSConfig` with a non-zero `Renegotiation`
|
||||||
|
value and if it's not the default on your server, set `ssl_renegotiation`
|
||||||
|
via `ConnConfig.RuntimeParams`.
|
||||||
|
|
||||||
Logging
|
Logging
|
||||||
|
|
||||||
pgx defines a simple logger interface. Connections optionally accept a logger
|
pgx defines a simple logger interface. Connections optionally accept a logger
|
||||||
|
|
Loading…
Reference in New Issue