From 8ecc9209e6205e90ab622494a9a28f6a97c0874d Mon Sep 17 00:00:00 2001 From: Madison Chamberlain <46542378+madisonchamberlain@users.noreply.github.com> Date: Thu, 23 May 2024 13:53:09 -0700 Subject: [PATCH] Proposed solution for tls skip verify option --- connector.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/connector.go b/connector.go index 96a88319..e29b1d96 100644 --- a/connector.go +++ b/connector.go @@ -2,6 +2,7 @@ package dbsql import ( "context" + "crypto/tls" "database/sql/driver" "fmt" "net/http" @@ -107,6 +108,13 @@ func withUserConfig(ucfg config.UserConfig) connOption { } } +// WithServerHostname sets up the server hostname. Mandatory. +func WithSkipInsecureSkipVerify(host string) connOption { + return func(c *config.Config) { + c.TLSConfig = &tls.Config{InsecureSkipVerify: true} + } +} + // WithServerHostname sets up the server hostname. Mandatory. func WithServerHostname(host string) connOption { return func(c *config.Config) {