Skip to content

Commit

Permalink
Merge pull request #24 from sensu/use-default-ciphersuites
Browse files Browse the repository at this point in the history
use default tls cipher suits
  • Loading branch information
c-kruse committed Dec 27, 2022
2 parents b639826 + 31923e3 commit c10ac4c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
4 changes: 1 addition & 3 deletions cmd/http-check/main.go
Expand Up @@ -13,9 +13,9 @@ import (
"strings"
"time"

"github.com/sensu/sensu-plugin-sdk/sensu"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/types"
"github.com/sensu/sensu-plugin-sdk/sensu"
)

// Config represents the check plugin config.
Expand Down Expand Up @@ -154,8 +154,6 @@ func checkArgs(event *types.Event) (int, error) {
}
tlsConfig.InsecureSkipVerify = plugin.InsecureSkipVerify

tlsConfig.CipherSuites = corev2.DefaultCipherSuites

if (len(plugin.MTLSKeyFile) > 0 && len(plugin.MTLSCertFile) == 0) || (len(plugin.MTLSCertFile) > 0 && len(plugin.MTLSKeyFile) == 0) {
return sensu.CheckStateWarning, fmt.Errorf("mTLS auth requires both --mtls-key-file and --mtls-cert-file")
}
Expand Down
6 changes: 2 additions & 4 deletions cmd/http-get/main.go
Expand Up @@ -13,8 +13,8 @@ import (
"strings"
"time"

"github.com/sensu/sensu-plugin-sdk/sensu"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-plugin-sdk/sensu"
)

// Config represents the check plugin config.
Expand Down Expand Up @@ -133,8 +133,6 @@ func checkArgs(event *corev2.Event) (int, error) {
}
tlsConfig.InsecureSkipVerify = plugin.InsecureSkipVerify

tlsConfig.CipherSuites = corev2.DefaultCipherSuites

if (len(plugin.MTLSKeyFile) > 0 && len(plugin.MTLSCertFile) == 0) || (len(plugin.MTLSCertFile) > 0 && len(plugin.MTLSKeyFile) == 0) {
return sensu.CheckStateWarning, fmt.Errorf("mTLS auth requires both --mtls-key-file and --mtls-cert-file")
}
Expand Down Expand Up @@ -197,7 +195,7 @@ func executeCheck(event *corev2.Event) (int, error) {
return sensu.CheckStateCritical, nil
}

fmt.Printf("%s",string(body))
fmt.Printf("%s", string(body))

return sensu.CheckStateOK, nil
}
4 changes: 1 addition & 3 deletions cmd/http-json/main.go
Expand Up @@ -16,8 +16,8 @@ import (

"github.com/PaesslerAG/gval"
"github.com/itchyny/gojq"
"github.com/sensu/sensu-plugin-sdk/sensu"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-plugin-sdk/sensu"
)

// Config represents the check plugin config.
Expand Down Expand Up @@ -156,8 +156,6 @@ func checkArgs(event *corev2.Event) (int, error) {
}
tlsConfig.InsecureSkipVerify = plugin.InsecureSkipVerify

tlsConfig.CipherSuites = corev2.DefaultCipherSuites

if (len(plugin.MTLSKeyFile) > 0 && len(plugin.MTLSCertFile) == 0) || (len(plugin.MTLSCertFile) > 0 && len(plugin.MTLSKeyFile) == 0) {
return sensu.CheckStateWarning, fmt.Errorf("mTLS auth requires both --mtls-key-file and --mtls-cert-file")
}
Expand Down
4 changes: 1 addition & 3 deletions cmd/http-perf/main.go
Expand Up @@ -9,9 +9,9 @@ import (
"strings"
"time"

"github.com/sensu/sensu-plugin-sdk/sensu"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/types"
"github.com/sensu/sensu-plugin-sdk/sensu"
)

// Config represents the check plugin config.
Expand Down Expand Up @@ -171,8 +171,6 @@ func checkArgs(event *types.Event) (int, error) {
}
tlsConfig.InsecureSkipVerify = plugin.InsecureSkipVerify

tlsConfig.CipherSuites = corev2.DefaultCipherSuites

if (len(plugin.MTLSKeyFile) > 0 && len(plugin.MTLSCertFile) == 0) || (len(plugin.MTLSCertFile) > 0 && len(plugin.MTLSKeyFile) == 0) {
return sensu.CheckStateWarning, fmt.Errorf("mTLS auth requires both --mtls-key-file and --mtls-cert-file")
}
Expand Down

0 comments on commit c10ac4c

Please sign in to comment.