summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2021-04-30 14:15:30 +0100
committerNick Thomas <nick@gitlab.com>2021-04-30 14:32:06 +0100
commit4545fc56e23b476ca2b54cc23ec72a0aa0d7dae1 (patch)
tree8175967320e2fa8e022e5629d6f39b2ddcfe16bb /internal/config/config.go
parent584643e0e10e0cbeee4f8366b5e50656dfee9ea4 (diff)
downloadgitlab-shell-4545fc56e23b476ca2b54cc23ec72a0aa0d7dae1.tar.gz
gitlab-sshd: Respect the ssl_cert_dir config516-handle-ssl-cert-dir-correctly
Changelog: fixed
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index ed061a8..e3dd7c2 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -4,6 +4,7 @@ import (
"errors"
"io/ioutil"
"net/url"
+ "os"
"path"
"path/filepath"
"sync"
@@ -74,6 +75,12 @@ var (
}
)
+func (c *Config) ApplyGlobalState() {
+ if c.SslCertDir != "" {
+ os.Setenv("SSL_CERT_DIR", c.SslCertDir)
+ }
+}
+
func (c *Config) HttpClient() *client.HttpClient {
c.httpClientOnce.Do(func() {
c.httpClient = client.NewHTTPClient(
@@ -96,6 +103,9 @@ func NewFromDirExternal(dir string) (*Config, error) {
if err != nil {
return nil, err
}
+
+ cfg.ApplyGlobalState()
+
return cfg, nil
}