1
0
Fork 0

Fix system-level tests

master
Philip O'Toole 2 years ago
parent a3fc60b9b5
commit 50d70b547e

@ -624,7 +624,7 @@ func mustNodeEncryptedOnDisk(dir string, enableSingle, httpEncrypt bool, mux *tc
}
node.Cluster = clstr
clstrDialer := tcp.NewDialer(cluster.MuxClusterHeader, false, true)
clstrDialer := tcp.NewDialer(cluster.MuxClusterHeader, nil)
clstrClient := cluster.NewClient(clstrDialer, 30*time.Second)
node.Service = httpd.New("localhost:0", node.Store, clstrClient, nil)
node.Service.Expvar = true
@ -694,7 +694,7 @@ func mustNewOpenTLSMux(certFile, keyPath, addr string) *tcp.Mux {
}
var mux *tcp.Mux
mux, err = tcp.NewTLSMux(ln, nil, certFile, keyPath, "", true)
mux, err = tcp.NewTLSMux(ln, nil, certFile, keyPath, "", "", "", true)
if err != nil {
panic(fmt.Sprintf("failed to create node-to-node mux: %s", err.Error()))
}

@ -1,11 +1,14 @@
package system
import (
"crypto/tls"
"fmt"
"testing"
"time"
"github.com/rqlite/rqlite/cluster"
"github.com/rqlite/rqlite/command"
"github.com/rqlite/rqlite/rtls"
"github.com/rqlite/rqlite/tcp"
)
@ -300,5 +303,13 @@ func queryRequestFromStrings(s []string) *command.QueryRequest {
}
func mustNewDialer(header byte, remoteEncrypted, skipVerify bool) *tcp.Dialer {
return tcp.NewDialer(header, remoteEncrypted, skipVerify)
var tlsConfig *tls.Config
var err error
if remoteEncrypted {
tlsConfig, err = rtls.CreateClientConfig("", "", "", skipVerify, false)
if err != nil {
panic(fmt.Sprintf("failed to create client TLS config: %s", err))
}
}
return tcp.NewDialer(header, tlsConfig)
}

Loading…
Cancel
Save