MCPcopy Create free account
hub / github.com/prometheus/common / TestTLSConfigEmpty

Function TestTLSConfigEmpty

config/http_config_test.go:792–809  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

790}
791
792func TestTLSConfigEmpty(t *testing.T) {
793 configTLSConfig := TLSConfig{
794 InsecureSkipVerify: true,
795 }
796
797 expectedTLSConfig := &tls.Config{
798 InsecureSkipVerify: configTLSConfig.InsecureSkipVerify,
799 }
800
801 tlsConfig, err := NewTLSConfig(&configTLSConfig)
802 if err != nil {
803 t.Fatalf("Can't create a new TLS Config from a configuration (%s).", err)
804 }
805
806 if !reflect.DeepEqual(tlsConfig, expectedTLSConfig) {
807 t.Fatalf("Unexpected TLS Config result: \n\n%+v\n expected\n\n%+v", tlsConfig, expectedTLSConfig)
808 }
809}
810
811func TestTLSConfigInvalidCA(t *testing.T) {
812 invalidTLSConfig := []struct {

Callers

nothing calls this directly

Calls 1

NewTLSConfigFunction · 0.85

Tested by

no test coverage detected