chore: ⬆️ Vendor for new deps

This commit is contained in:
2026-02-07 15:51:20 +02:00
parent 88589e00e7
commit 47bf748fd5
128 changed files with 83822 additions and 29 deletions

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

View 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
}

View 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
}

View 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
}

View 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
}

View 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

View 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

View 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{}