Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/http_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (tv *TLSVersion) String() string {
return s
}
}
return fmt.Sprintf("%d", tv)
return fmt.Sprintf("%d", *tv)
}

// BasicAuth contains basic HTTP authentication credentials.
Expand Down
7 changes: 7 additions & 0 deletions config/tls_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ func TestTLSVersionStringer(t *testing.T) {
require.Equalf(t, "TLS13", s.String(), "tls.VersionTLS13 string should be TLS13, got %s", s.String())
}

func TestTLSVersionStringerUnknown(t *testing.T) {
// An unknown TLS version (not present in TLSVersions) must fall back to its
// numeric value, not to the pointer address.
s := TLSVersion(0x9999) // 39321
require.Equal(t, "39321", s.String())
}

func TestTLSVersionMarshalYAML(t *testing.T) {
tests := []struct {
input TLSVersion
Expand Down
Loading