mirror of https://github.com/jackc/pgx.git
update
parent
924834b5b4
commit
ddd966f09f
|
@ -51,7 +51,7 @@ type Config struct {
|
||||||
KerberosSpn string
|
KerberosSpn string
|
||||||
Fallbacks []*FallbackConfig
|
Fallbacks []*FallbackConfig
|
||||||
|
|
||||||
SSLnegotiation string // sslnegotiation=postgres or sslnegotiation=direct
|
SSLNegotiation string // sslnegotiation=postgres or sslnegotiation=direct
|
||||||
|
|
||||||
// ValidateConnect is called during a connection attempt after a successful authentication with the PostgreSQL server.
|
// ValidateConnect is called during a connection attempt after a successful authentication with the PostgreSQL server.
|
||||||
// It can be used to validate that the server is acceptable. If this returns an error the connection is closed and the next
|
// It can be used to validate that the server is acceptable. If this returns an error the connection is closed and the next
|
||||||
|
@ -389,7 +389,7 @@ func ParseConfigWithOptions(connString string, options ParseConfigOptions) (*Con
|
||||||
config.Port = fallbacks[0].Port
|
config.Port = fallbacks[0].Port
|
||||||
config.TLSConfig = fallbacks[0].TLSConfig
|
config.TLSConfig = fallbacks[0].TLSConfig
|
||||||
config.Fallbacks = fallbacks[1:]
|
config.Fallbacks = fallbacks[1:]
|
||||||
config.SSLnegotiation = settings["sslnegotiation"]
|
config.SSLNegotiation = settings["sslnegotiation"]
|
||||||
|
|
||||||
passfile, err := pgpassfile.ReadPassfile(settings["passfile"])
|
passfile, err := pgpassfile.ReadPassfile(settings["passfile"])
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|
|
@ -329,7 +329,7 @@ func connectOne(ctx context.Context, config *Config, connectConfig *connectOneCo
|
||||||
tlsConn net.Conn
|
tlsConn net.Conn
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
if config.SSLnegotiation == "direct" {
|
if config.SSLNegotiation == "direct" {
|
||||||
tlsConn = tls.Client(pgConn.conn, connectConfig.tlsConfig)
|
tlsConn = tls.Client(pgConn.conn, connectConfig.tlsConfig)
|
||||||
} else {
|
} else {
|
||||||
tlsConn, err = startTLS(pgConn.conn, connectConfig.tlsConfig)
|
tlsConn, err = startTLS(pgConn.conn, connectConfig.tlsConfig)
|
||||||
|
|
Loading…
Reference in New Issue