func NewDbSSLMode(o options, requireCanVerifyCA bool) (DbSSLMode, error) {
	sslMode := DbSSLMode{Options: o, UseTLS: true}
	switch mode := o["sslmode"]; mode {
	case "disable":
		sslMode.UseTLS = false
	case "", "require":
		sslMode.InsecureSkipVerify = true
		if requireCanVerifyCA && len(o["sslrootcert"]) > 0 {
			sslMode.VerifyCaOnly = true
		}
	case "verify-ca":
		sslMode.InsecureSkipVerify = true
		sslMode.VerifyCaOnly = true
	case "verify-full":
		sslMode.InsecureSkipVerify = false
		sslMode.VerifyCaOnly = false
		if len(o["sslhost"]) > 0 {
			sslMode.ServerName = o["sslhost"]
		} else {
			sslMode.ServerName = o["host"]
		}
	default:
		return DbSSLMode{}, fmt.Errorf(`unsupported sslmode %q; only "require" (default), "verify-ca", "verify-full" and "disable" supported`, mode)
	}
	return sslMode, nil
}
NewDbSSLMode configures and creates a DbSSLMode
package ssl
import (
	"crypto/tls"
	"crypto/x509"
	"fmt"
	"net"
)
type options map[string]string
type DbSSLMode struct {
	tls.Config
	UseTLS       bool
	VerifyCaOnly bool
	Options      options
}