chore: ⬆️ Vendor for new deps
This commit is contained in:
1068
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str.go
generated
vendored
Normal file
1068
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
22
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go112.go
generated
vendored
Normal file
22
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go112.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
//go:build go1.12
|
||||
// +build go1.12
|
||||
|
||||
package msdsn
|
||||
|
||||
import "crypto/tls"
|
||||
|
||||
func TLSVersionFromString(minTLSVersion string) uint16 {
|
||||
switch minTLSVersion {
|
||||
case "1.0":
|
||||
return tls.VersionTLS10
|
||||
case "1.1":
|
||||
return tls.VersionTLS11
|
||||
case "1.2":
|
||||
return tls.VersionTLS12
|
||||
case "1.3":
|
||||
return tls.VersionTLS13
|
||||
default:
|
||||
// use the tls package default
|
||||
}
|
||||
return 0
|
||||
}
|
||||
20
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go112pre.go
generated
vendored
Normal file
20
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go112pre.go
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
//go:build !go1.12
|
||||
// +build !go1.12
|
||||
|
||||
package msdsn
|
||||
|
||||
import "crypto/tls"
|
||||
|
||||
func TLSVersionFromString(minTLSVersion string) uint16 {
|
||||
switch minTLSVersion {
|
||||
case "1.0":
|
||||
return tls.VersionTLS10
|
||||
case "1.1":
|
||||
return tls.VersionTLS11
|
||||
case "1.2":
|
||||
return tls.VersionTLS12
|
||||
default:
|
||||
// use the tls package default
|
||||
}
|
||||
return 0
|
||||
}
|
||||
35
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go115.go
generated
vendored
Normal file
35
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go115.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
//go:build go1.15
|
||||
// +build go1.15
|
||||
|
||||
package msdsn
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func setupTLSCommonName(config *tls.Config, pem []byte) error {
|
||||
// fix for https://github.com/denisenkom/go-mssqldb/issues/704
|
||||
// A SSL/TLS certificate Common Name (CN) containing the ":" character
|
||||
// (which is a non-standard character) will cause normal verification to fail.
|
||||
// Since the VerifyConnection callback runs after normal certificate
|
||||
// verification, confirm that SetupTLS() has been called
|
||||
// with "insecureSkipVerify=false", then InsecureSkipVerify must be set to true
|
||||
// for this VerifyConnection callback to accomplish certificate verification.
|
||||
config.InsecureSkipVerify = true
|
||||
config.VerifyConnection = func(cs tls.ConnectionState) error {
|
||||
commonName := cs.PeerCertificates[0].Subject.CommonName
|
||||
if commonName != cs.ServerName {
|
||||
return fmt.Errorf("invalid certificate name %q, expected %q", commonName, cs.ServerName)
|
||||
}
|
||||
opts := x509.VerifyOptions{
|
||||
Roots: nil,
|
||||
Intermediates: x509.NewCertPool(),
|
||||
}
|
||||
opts.Intermediates.AppendCertsFromPEM(pem)
|
||||
_, err := cs.PeerCertificates[0].Verify(opts)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
14
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go115pre.go
generated
vendored
Normal file
14
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go115pre.go
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
//go:build !go1.15
|
||||
// +build !go1.15
|
||||
|
||||
package msdsn
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
)
|
||||
|
||||
func setupTLSCommonName(config *tls.Config, pemData []byte) error {
|
||||
// Prior to Go 1.15, the TLS allowed ":" when checking the hostname.
|
||||
// See https://golang.org/issue/40748 for details.
|
||||
return skipSetup
|
||||
}
|
||||
10
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go118.go
generated
vendored
Normal file
10
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go118.go
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
//go:build go1.18
|
||||
// +build go1.18
|
||||
|
||||
package msdsn
|
||||
|
||||
// disableRetryDefault is false for Go versions 1.18 and higher. This matches
|
||||
// the behavior requested in issue #586. A query that fails at the start due to
|
||||
// a bad connection is automatically retried. An error is returned only if the
|
||||
// query fails all of its retries.
|
||||
const disableRetryDefault bool = false
|
||||
10
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go118pre.go
generated
vendored
Normal file
10
vendor/github.com/microsoft/go-mssqldb/msdsn/conn_str_go118pre.go
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
//go:build !go1.18
|
||||
// +build !go1.18
|
||||
|
||||
package msdsn
|
||||
|
||||
// disableRetryDefault is true for versions of Go less than 1.18. This matches
|
||||
// the behavior requested in issue #275. A query that fails at the start due to
|
||||
// a bad connection is not retried. Instead, the detailed error is immediately
|
||||
// returned to the caller.
|
||||
const disableRetryDefault bool = true
|
||||
20
vendor/github.com/microsoft/go-mssqldb/msdsn/extensions.go
generated
vendored
Normal file
20
vendor/github.com/microsoft/go-mssqldb/msdsn/extensions.go
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
package msdsn
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
)
|
||||
|
||||
type BrowserData map[string]map[string]string
|
||||
|
||||
// ProtocolDialer makes the network connection for a protocol
|
||||
type ProtocolDialer interface {
|
||||
// Translates data from SQL Browser to parameters in the config
|
||||
ParseBrowserData(data BrowserData, p *Config) error
|
||||
// DialConnection eturns a Dialer to make the connection. On success, also set Config.ServerSPN if it is unset.
|
||||
DialConnection(ctx context.Context, p *Config) (conn net.Conn, err error)
|
||||
// Returns true if information is needed from the SQL Browser service to make a connection
|
||||
CallBrowser(p *Config) bool
|
||||
}
|
||||
|
||||
var ProtocolDialers map[string]ProtocolDialer = map[string]ProtocolDialer{}
|
||||
Reference in New Issue
Block a user