From 98268a3e940897fd08e3d971fa6b9dbed67cbcef Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Wed, 14 Feb 2024 19:48:14 -0800 Subject: [PATCH 1/3] Implement server TLS support --- Changes.md | 5 ++- client/faktory.go | 2 +- server/server.go | 77 +++++++++++++++++++++++++++++++++++++++---- server/server_test.go | 2 +- webui/web.go | 10 ++++-- 5 files changed, 85 insertions(+), 11 deletions(-) diff --git a/Changes.md b/Changes.md index c0acbbe..cec9b2c 100644 --- a/Changes.md +++ b/Changes.md @@ -2,8 +2,11 @@ Changelog: Faktory || [Faktory Enterprise](https://github.com/contribsys/faktory/blob/master/Ent-Changes.md) -## HEAD +## 1.9.0 +- Implement native TLS support [#469] + Put `public.cert.pem` and `private.key.pem` in your config directory + and Faktory will automatically enable TLS on port 7419 and 7420. - Unwrap and display ActiveJob class names [#460, ibrahima] - Add Go client API so batches can push jobs in bulk [#437, tylerian] diff --git a/client/faktory.go b/client/faktory.go index e495d91..110bfe1 100644 --- a/client/faktory.go +++ b/client/faktory.go @@ -2,5 +2,5 @@ package client var ( Name = "Faktory" - Version = "1.8.1" + Version = "1.9.0" ) diff --git a/server/server.go b/server/server.go index 0376ef7..a7e0f92 100644 --- a/server/server.go +++ b/server/server.go @@ -5,11 +5,14 @@ import ( "context" "crypto/sha256" "crypto/subtle" + "crypto/tls" + "errors" "fmt" "io" "math/rand" "net" "os" + "path/filepath" "strconv" "strings" "sync" @@ -34,6 +37,10 @@ type Server struct { Stats *RuntimeStats Subsystems []Subsystem + TLSPublicCert string + TLSPrivateKey string + + tlsConfig *tls.Config listener net.Listener store storage.Store manager manager.Manager @@ -44,6 +51,41 @@ type Server struct { closed bool } +func (s *Server) useTLS() error { + privateKey := filepath.Join(s.Options.ConfigDirectory, "private.key.pem") + publicCert := filepath.Join(s.Options.ConfigDirectory, "public.cert.pem") + + if _, err := os.Stat(privateKey); errors.Is(err, os.ErrNotExist) { + return nil + } + if _, err := os.Stat(publicCert); errors.Is(err, os.ErrNotExist) { + return nil + } + x, err := os.Open(privateKey) + if err != nil { + return fmt.Errorf("Unable to open private key: %w", err) + } + defer x.Close() + y, err := os.Open(publicCert) + if err != nil { + return fmt.Errorf("Unable to open public cert: %w", err) + } + defer y.Close() + cert, err := tls.LoadX509KeyPair(publicCert, privateKey) + if err != nil { + return fmt.Errorf("Unable to initialize TLS certificate: %w", err) + } + util.Infof("TLS activated with %s", publicCert) + + s.TLSPublicCert = publicCert + s.TLSPrivateKey = privateKey + s.tlsConfig = &tls.Config{ + Certificates: []tls.Certificate{cert}, + MinVersion: tls.VersionTLS12, + } + return nil +} + func NewServer(opts *ServerOptions) (*Server, error) { if opts.Binding == "" { opts.Binding = "localhost:7419" @@ -95,7 +137,17 @@ func (s *Server) Boot() error { return fmt.Errorf("cannot open redis database: %w", err) } - listener, err := net.Listen("tcp", s.Options.Binding) + err = s.useTLS() + if err != nil { + return err + } + + var listener net.Listener + if s.tlsConfig != nil { + listener, err = tls.Listen("tcp", s.Options.Binding, s.tlsConfig) + } else { + listener, err = net.Listen("tcp", s.Options.Binding) + } if err != nil { store.Close() return fmt.Errorf("cannot listen on %s: %w", s.Options.Binding, err) @@ -221,19 +273,32 @@ func startConnection(conn net.Conn, s *Server) *Connection { line, err := buf.ReadString('\n') if err != nil { + defer conn.Close() // TCP probes on the socket will close connection // immediately and lead to EOF. Don't flood logs with them. - if err != io.EOF { - util.Error("Bad connection", err) + if errors.Is(err, io.EOF) { + return nil } - conn.Close() + + opErr, ok := err.(net.Error) + if ok && opErr.Timeout() { + // util.Debugf("Error establishing connection with client %v", err) + return nil + } + _, ok = err.(tls.RecordHeaderError) + if ok { + // util.Debugf("Client not using TLS %v", err) + return nil + + } + util.Infof("Bad connection %T: %v", err, err) return nil } valid := strings.HasPrefix(line, "HELLO {") if !valid { - util.Infof("Invalid preamble: %s", line) - util.Info("Need a valid HELLO") + util.Debugf("Invalid preamble: %s", line) + util.Debug("Need a valid HELLO, is client using TLS?") conn.Close() return nil } diff --git a/server/server_test.go b/server/server_test.go index a9a49a0..8f8b222 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -31,7 +31,7 @@ func runServer(binding string, runner func()) { Binding: binding, StorageDirectory: dir, RedisSock: sock, - ConfigDirectory: os.ExpandEnv("$HOME/.faktory"), + ConfigDirectory: os.ExpandEnv("test/.faktory"), } s, err := NewServer(opts) if err != nil { diff --git a/webui/web.go b/webui/web.go index cc8b328..fd491c1 100644 --- a/webui/web.go +++ b/webui/web.go @@ -271,12 +271,18 @@ func (ui *WebUI) Run() (func(), error) { } go func() { - err := s.ListenAndServe() + var err error + if ui.Server.TLSPrivateKey != "" { + util.Infof("Web server now listening via TLS at %s", ui.Options.Binding) + err = s.ListenAndServeTLS(ui.Server.TLSPublicCert, ui.Server.TLSPrivateKey) + } else { + util.Infof("Web server now listening at %s", ui.Options.Binding) + err = s.ListenAndServe() + } if err != http.ErrServerClosed { util.Error(fmt.Sprintf("%s server crashed", ui.Options.Binding), err) } }() - util.Infof("Web server now listening at %s", ui.Options.Binding) return func() { _ = s.Shutdown(context.Background()) }, nil } From 343984eb3eca1ed104668c495ca539176f21fb36 Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Mon, 19 Feb 2024 12:14:01 -0800 Subject: [PATCH 2/3] remove ancient tls test content --- test/tls/1/private.key | 51 -------------------------------- test/tls/1/public.crt | 37 ----------------------- test/tls/2/ca.crt | 67 ------------------------------------------ test/tls/2/private.key | 51 -------------------------------- test/tls/2/public.crt | 37 ----------------------- 5 files changed, 243 deletions(-) delete mode 100644 test/tls/1/private.key delete mode 100644 test/tls/1/public.crt delete mode 100644 test/tls/2/ca.crt delete mode 100644 test/tls/2/private.key delete mode 100644 test/tls/2/public.crt diff --git a/test/tls/1/private.key b/test/tls/1/private.key deleted file mode 100644 index 416f7e7..0000000 --- a/test/tls/1/private.key +++ /dev/null @@ -1,51 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIJKAIBAAKCAgEAxUZLxEr2Ee0hV/lhZwvNEO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nF5KyJ2rsb50N -GDGrJvpo6tp11YLIfwOM7BcydcOlOH3bwA+hcMMEIaoT0kLw2Ww005wba6AuG/l1 -ErBPFaE76kGq6pcUmPvrSxoj7HQZcTDINNtv9bzG5xDtbb7MnI+WlKje3TWA9Ad2 -87u80F+LiRxrZQ7w/EhEiW/VGO2IcEMrZGo5eHED4Fh7rSYs1gAInFnjPMCbQin3 -uXs2JXUauhJf1AlpSUv92+hnD+mY9FrxMxk2shFK15TnoP5CKnqW03q52S4Pv4jq -JrWNAoIBAFUu+TvyuFK/prsGvApBlNZLu6+rCbprr1JXTbLgOyTuStYufcwQPNZF -qU0ArZFzFlwvVv6lwtmSbzZeWXB1BsZrfFICbcBmM4o2ZzWJkbuKmMbvJ6UY8Sez -ZiJxruWgYD75uMzymFLGYyKPfi5G9LEiXVUboNXNoNAgjaTs/SsCyuCZ3QvE7WgS -WuBf5GB+wF0z3HgTo474/LNKcL1BVarI8KR5lK7cF5JOOW0MF4e8KLp5MG+lfEMX -AvsPcowDeZHCyCDPKs/s+pBMPebeU8sd8GOfClWhpD9Y0Ims6YAsR7U8Ame0KCxR -culz2dEIiqQn+vQgeCpxSOOzHMhBbhMCggEBAKGG/gvvSqAN9Blv5HPhyHI9SzQe -QaZmf/dbqF4d8YNM74Hbl8y7wXXjMN1hTJGH9REAybDiOT+iKZTonVxnZi0RSxGR -TihtcGRWHDWYrTsqkRi2d5xsOY13Dv67SCIg1j2Qiu/wIVecM6nuRn5kwKZ9rxgb -nvdFjFCJgm9p8vKLaP/ivjuA+E/u3bcALpxTJO4/D6awq2VeHYjH7xoo9toZ2oBL -d1HT7yCCHCERWSh5Eit/S2yB9t/q57qUnGTnVHgaCzajKw31iWQmplAw6F0Ze9cb -zUgYLM5eDnLFI80pJtLFIIv5LXBDVPG+s3eDw387Q5MCwLQKmtCoKeh7vmE= ------END RSA PRIVATE KEY----- diff --git a/test/tls/1/public.crt b/test/tls/1/public.crt deleted file mode 100644 index 17f73ba..0000000 --- a/test/tls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JXTzM22qfG0uGi8q7vpGwh11koX6lrIj2A -70BkKq2iqqR5EtWOtA50nfcr4DSNHXho9ACCVz3zh0fR7xd7ectkw+m6/8eqxzN3 -FRTEJZbWfu95YYciTmyeKrgN7uuUk/dkiDqxE/OM ------END CERTIFICATE----- diff --git a/test/tls/2/ca.crt b/test/tls/2/ca.crt deleted file mode 100644 index 4bdfcc7..0000000 --- a/test/tls/2/ca.crt +++ /dev/null @@ -1,67 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIGCDCCA/CgAwIBAgIQKy5u6tl1NmwUim7bo3yMBzANBgkqhkiG9w0BAQwFADCB -hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV -BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQwMjEy -MDAwMDAwWhcNMjkwMjExMjM1OTU5WjCBkDELMAkGA1UEBhMCR0IxGzAZBgNVBAgT -EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR -Q09NT0RPIENBIExpbWl0ZWQxNjA0BgNVBAMTLUNPTU9ETyBSU0EgRG9tYWluIFZh -bGlkYXRpb24gU2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAI7CAhnhoFmk6zg1jSz9AdDTScBkxwtiBUUWOqigwAwCfx3M28Sh -bXcDow+G+eMGnD4LgYqbSRutA776S9uMIO3Vzl5ljj4Nr0zCsLdFXlIvNN5IJGS0 -Qa4Al/e+Z96e0HqnU4A7fK31llVvl0cKfIWLIpeNs4TgllfQcBhglo/uLQeTnaG6 -ytHNe+nEKpooIZFNb5JPJaXyejXdJtxGpdCsWTWM/06RQ1A/WZMebFEh7lgUq/51 -UHg+TLAchhP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VYFhH2+9uRv0V9dlfmrPb2LjkQLPNlzmuhbsdjrzch5vR -pu/xO28QOG8= ------END CERTIFICATE----- diff --git a/test/tls/2/private.key b/test/tls/2/private.key deleted file mode 100644 index 416f7e7..0000000 --- a/test/tls/2/private.key +++ /dev/null @@ -1,51 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIJKAIBAAKCAgEAxUZLxEr2Ee0hV/lhZwvNEOR+Mm7QC0uMNokgVihg6T30mfHT -1BDJNA5GgQUjm4pB46hKzQKnfbE3D9ixtaPbMQjoOYEK7iPhzI0kpO8CzGV1s/ka -s2Q3hs1bnGYoaKOy72I6U1tzI6UrwKOWiNttRnpAdni3KUBTokIa/vIAy+RoiUUv -WeV/OhdhtHQFelb4gQmA1xCNgsMyUXue2CYJXZ1sX/1bc0EWh+OEuU/YDJfbK6FJ -aIpBkz5pfuRzpPhV+zmW1iLikSPPBY0TZ+cyyO4qnBOLhtwGkuC4g+sQLRuPjGJE -3ocaWN9GyRk4NT8Au3sobe5e5Yb4SXXCriqoyNuRgVnSgVn+VcSb0m0f3wxAtC2c -u5v12bL6b2jg4be6lluTQiniCMt1JplWJ/Oc5FEo/Lp4EAIisJqHhNJD4n1EDJFL -Y6UCwru5nR8YrW9PWSquUYY2NuwNZN7chau5Ghbbe7N9l9aF2keAGvuxTCcyRKg9 -LFLBGy4h1fkxD1xt9+NfvKQJyZS5WU3CyunIlknpikwUTtYVTrMQJ/PxtzbeLBVT -6hMGrLDu2yAACWVDoQn3zks13e73wgV6/XkQ/5TZAhlOdiGzMLaj9sFwsqappgA9 -6LQOHtP/2y81zED3s9T4z7CNk2iTWXHp8kab5pOGfriBha3doUl4rKeB1q0CAwEA -AQKCAgB1cWwZ6CamdW2sWiLKnhPvQph+ncntb4SB0xEVOeS39tJv87AQSA4Al58R -oGWaa6zeQ4qEklf0VFRbcr4ZTPtpLcxSr6g6LdJ3XG+8YS5hUOXJxztGIRuNfSRU -79yOryYPrYLbrU3WorZxcPJld3yOwKk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awq2VeHYjH7xoo9toZ2oBL -d1HT7yCCHCERWSh5Eit/S2yB9t/q57qUnGTnVHgaCzajKw31iWQmplAw6F0Ze9cb -zUgYLM5eDnLFI80pJtLFIIv5LXBDVPG+s3eDw387Q5MCwLQKmtCoKeh7vmE= ------END RSA PRIVATE KEY----- diff --git a/test/tls/2/public.crt b/test/tls/2/public.crt deleted file mode 100644 index 17f73ba..0000000 --- a/test/tls/2/public.crt +++ /dev/null @@ -1,37 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIGejCCBGKgAwIBAgIJAKM//nNduDqwMA0GCSqGSIb3DQEBBQUAMIGEMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCT1IxETAPBgNVBAcTCFBvcnRsYW5kMRMwEQYDVQQK -Ewpjb250cmlic3lzMRkwFwYDVQQDExBhY21lLmV4YW1wbGUuY29tMSUwIwYJKoZI -hvcNAQkBFhZzdXBwb3J0QGNvbnRyaWJzeXMuY29tMB4XDTE3MTAxMDIwNTQxMFoX -DTE4MTAxMDIwNTQxMFowgYQxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJPUjERMA8G -A1UEBxMIUG9ydGxhbmQxEzARBgNVBAoTCmNvbnRyaWJzeXMxGTAXBgNVBAMTEGFj -bWUuZXhhbXBsZS5jb20xJTAjBgkqhkiG9w0BCQEWFnN1cHBvcnRAY29udHJpYnN5 -cy5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDFRkvESvYR7SFX -+WFnC80Q5H4ybtALS4w2iSBWKGDpPfSZ8dPUEMk0DkaBBSObikHjqErNAqd9sTcP -2LG1o9sxCOg5gQruI+HMjSSk7wLMZXWz+RqzZDeGzVucZihoo7LvYjpTW3MjpSvA -o5aI221GekB2eLcpQFOiQhr+8gDL5GiJRS9Z5X86F2G0dAV6VviBCYDXEI2CwzJR -e57YJgldnWxf/VtzQRaH44S5T9gMl9sroUloikGTPml+5HOk+FX7OZbWIuKRI88F -jRNn5zLI7iqcE4uG3Aa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LffxR -k5XQfGW4/tQIC1LKY6mZspVBUEWRw4EicFccnlGxoFgrsuq+B+FxXQ87qeCG9mV8 -69jD5uOBC1Evf21po8x11eb6FD+pr+ycnA/DgCeNhiSGxL65TgIEFd3g0bejCNAn -a6LPyUmpOPn/ivw1kbqfDeqL1xKCShIiLiJU15SDl3PcO3zIVrD81kMwPyBHV+5v -CKBcApgjKXhfrwwvqFEqSRwt8sPaJSJXTzM22qfG0uGi8q7vpGwh11koX6lrIj2A -70BkKq2iqqR5EtWOtA50nfcr4DSNHXho9ACCVz3zh0fR7xd7ectkw+m6/8eqxzN3 -FRTEJZbWfu95YYciTmyeKrgN7uuUk/dkiDqxE/OM ------END CERTIFICATE----- From 88223dd095fbf634deac46ddfa16dba2458ad3c4 Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Mon, 19 Feb 2024 12:45:49 -0800 Subject: [PATCH 3/3] Adjust system test to exercise TLS --- test/cfg/private.key.pem | 28 ++++++++++++++++++++++++++++ test/cfg/public.cert.pem | 25 +++++++++++++++++++++++++ test/go_system_test.go | 14 ++++++++++++-- 3 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 test/cfg/private.key.pem create mode 100644 test/cfg/public.cert.pem diff --git a/test/cfg/private.key.pem b/test/cfg/private.key.pem new file mode 100644 index 0000000..f57ef4d --- /dev/null +++ b/test/cfg/private.key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDNLCm+Mz3aqpxg +Y1lwiZjKBpWfT6W8ZJCRS75P5RAIAH3pOqO7g3ZmhQprA9KbtuKqjuDrdLnnkEC3 +jmE/7bLMFAVVbF+N1dj+1CtMsdH5T8aweC62XuaeHIc2MMvXiSX3QcAMUjdaXWW4 +wCNQhRJwbvE1XWcgzuoPJneeJdvCQLbW+c2B0vTI8k+lexz9iuVReWBumaFXubeE +vy4BeITGcWPnTsRZ7KJlPUwkfHxWxStatwI+gj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WLyGBOd5rK7tZDLQ0V4DytOtJzEF453wXmXl8cWTD9stGSMkdResHU5LHdLBT +RE8quS3IODMbRnoTxAhsYYfvBOgdtKHUezeNrbzXAoGAZai4rNxmuPKsZS2uuT45 +6edkS0OW9n8y6NHso8chxBsGdXuz45bbWdndW3Xs+4BTaahUOJ59ILvN+s4ZEG1z +6GALGp1Jg4dAvMCks6tvH2mPTK69Zjp8NZSuiNpJbhL1mHtmCchhZPEKW8f+BKLx +3W139Ps4mqU+H6oo45iOS1Y= +-----END PRIVATE KEY----- diff --git a/test/cfg/public.cert.pem b/test/cfg/public.cert.pem new file mode 100644 index 0000000..64eda26 --- /dev/null +++ b/test/cfg/public.cert.pem @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIUOf/FXcVBElRQYGEmbBqVoepecV4wDQYJKoZIhvcNAQEL +BQAwgbAxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIDAZPcmVnb24xETAPBgNVBAcMCFBv +cnRsYW5kMSAwHgYDVQQKDBdDb250cmlidXRlZCBTeXN0ZW1zIExMQzEQMA4GA1UE +CwwHRmFrdG9yeTEkMCIGA1UEAwwbZmFrdG9yeS10ZXN0LmNvbnRyaWJzeXMuY29t +MSMwIQYJKoZIhvcNAQkBFhRhZG1pbkBjb250cmlic3lzLmNvbTAeFw0yNDAyMTky +MDE2MzNaFw0yNTAyMTgyMDE2MzNaMIGwMQswCQYDVQQGEwJVUzEPMA0GA1UECAwG +T3JlZ29uMREwDwYDVQQHDAhQb3J0bGFuZDEgMB4GA1UECgwXQ29udHJpYnV0ZWQg +U3lzdGVtcyBMTEMxEDAOBgNVBAsMB0Zha3RvcnkxJDAiBgNVBAMMG2Zha3Rvcnkt +dGVzdC5jb250cmlic3lzLmNvbTEjMCEGCSqGSIb3DQEJARYUYWRtaW5AY29udHJp +YnN5cy5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNLCm+Mz3a +qpxgY1lwiZjKBpWfT6W8ZJCRS75P5RAIAH3pOqO7g3ZmhQprA9KbtuKqjuDrdLnn +kEC3jmE/7bLMFAVVbF+N1dj+1CtMsdH5T8aweC62XuaeHIc2MMvXiSX3QcAMUjda +XWW4wCNQhRJwbvE1XWcgzuoPJneeJdvCQLbW+c2B0vTI8k+lexz9iuVReWBumaFX +ubeEvy4BeITGcWPnTsRZ7KJlPUwkfHxWxStatwI+gjCXv76tOIM+6cWh0QHbUqnM +piOv0G4SkHunnI9DGxRv7jZBrQYCWqxO/G/bFceIoWCmTaGna+sMqprdH2SBHYDG +Iotns+sekDrXAgMBAAGjUzBRMB0GA1UdDgQWBBTydABM8WHFVsPGVpf5JXKqXuR3 +qjAfBgNVHSMEGDAWgBTydABM8WHFVsPGVpf5JXKqXuR3qjAPBgNVHRMBAf8EBTAD +AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBoofu4cyxCdZgq15+A4Zj1WyHX3DlSK+N0 +FUphoukwLLMyeo/WiTPkL76CLcP/0nu2GwbBmlNsGkBSJPhcxwrZXm3tGZ1fchrD +b6T60hYWskXju+D+LjoG8MXzImcF1FboCyVTePK+2+cy5Lmm1IwFaa+TeqyLeQnN +uM8YLDn+bx7/G+uHkZoCQCTb3iXl5gz197aVOKLfMC/8FIAO9lQspUHEOEzKPB5e +dkVQo4uwi9+8doXVVHfJmK1je/6/LNWaNKOeCkXRx5DICMdpsV+/4GPpR+YrTbBc +W4Q23OOsGsBNHVVcOC8fePHwPPfdEZqttwqo9yZUaizqpQCKRQ7M +-----END CERTIFICATE----- diff --git a/test/go_system_test.go b/test/go_system_test.go index 446a167..928a640 100644 --- a/test/go_system_test.go +++ b/test/go_system_test.go @@ -2,6 +2,7 @@ package tester import ( "context" + "crypto/tls" "fmt" "log" "math/rand" @@ -29,7 +30,7 @@ func TestSystem(t *testing.T) { dir := "/tmp/system.db" defer os.RemoveAll(dir) - opts.ConfigDirectory = "." + opts.ConfigDirectory = "./cfg" opts.StorageDirectory = dir s, stopper, err := cli.BuildServer(&opts) if stopper != nil { @@ -81,7 +82,16 @@ func TestSystem(t *testing.T) { func pushAndPop(t *testing.T, count int) { time.Sleep(300 * time.Millisecond) - cl, err := client.Dial(client.DefaultServer(), "123456") + s := &client.Server{ + Network: "tcp+tls", + Address: "localhost:7419", + Username: "", + Password: "", + Timeout: 1 * time.Second, + TLS: &tls.Config{InsecureSkipVerify: true, // nolint:gosec + MinVersion: tls.VersionTLS12}, + } + cl, err := client.Dial(s, "123456") if err != nil { handleError(err) return