diff --git a/cmd/dio_test.go b/cmd/dio_test.go index 67d47ef..cc19656 100644 --- a/cmd/dio_test.go +++ b/cmd/dio_test.go @@ -114,6 +114,17 @@ func (s *DioSuite) SetUpSuite(c *chk.C) { log.Fatalln(err) } TLSConfig.Certificates = []tls.Certificate{cert} + + // Load our self signed CA Cert chain, and set TLS1.2 as minimum + TLSConfig = tls.Config{ + Certificates: []tls.Certificate{cert}, + ClientCAs: ourCAPool, + InsecureSkipVerify: true, + MinVersion: tls.VersionTLS12, + PreferServerCipherSuites: true, + RootCAs: ourCAPool, + } + var email string certUser, email, _, err = getUserAndServer() if err != nil { diff --git a/cmd/root.go b/cmd/root.go index 692a1f5..5eee838 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -53,6 +53,11 @@ func init() { // Add support for pretty printing numbers numFormat = message.NewPrinter(message.MatchLanguage("en")) + // When run from go test we skip this, as we generate a temporary config file in the test suite setup + if os.Getenv("IS_TESTING") == "yes" { + return + } + // Add the global environment variables RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", fmt.Sprintf("config file (default is %s)", filepath.Join("$HOME", ".dio", "config.toml")))