Add ssl cert/key options

This commit is contained in:
Dan Sosedoff 2020-02-05 22:09:13 -06:00
parent 9c7f566d4d
commit ce4aea8da1
2 changed files with 10 additions and 2 deletions

View File

@ -18,8 +18,10 @@ type Options struct {
User string `long:"user" description:"Database user"`
Pass string `long:"pass" description:"Password for user"`
DbName string `long:"db" description:"Database name"`
Ssl string `long:"ssl" description:"SSL option"`
SslRootCert string `long:"ssl-root-cert" description:"SSL Root Cert"`
Ssl string `long:"ssl" description:"SSL mode"`
SslRootCert string `long:"ssl-rootcert" description:"SSL certificate authority file"`
SslCert string `long:"ssl-cert" description:"SSL client certificate file"`
SslKey string `long:"ssl-key" description:"SSL client certificate key file"`
HTTPHost string `long:"bind" description:"HTTP server host" default:"localhost"`
HTTPPort uint `long:"listen" description:"HTTP server listen port" default:"8081"`
AuthUser string `long:"auth-user" description:"HTTP basic auth user"`

View File

@ -115,6 +115,12 @@ func BuildStringFromOptions(opts command.Options) (string, error) {
query.Add("sslmode", "disable")
}
}
if opts.SslCert != "" {
query.Add("sslcert", opts.SslCert)
}
if opts.SslKey != "" {
query.Add("sslkey", opts.SslKey)
}
if opts.SslRootCert != "" {
query.Add("sslrootcert", opts.SslRootCert)
}