grafana/k6 · error

unknown TLS version '%s'

Error message

unknown TLS version '%s'

What it means

Raised by TLSVersion.UnmarshalJSON while parsing the tlsVersion option: the given version string is not a key in the SupportedTLSVersions map (e.g. a typo or unsupported TLS version name).

Source

Thrown at lib/options.go:50

// MarshalJSON implements the json.Marshaler interface
func (v TLSVersion) MarshalJSON() ([]byte, error) {
	return []byte(`"` + SupportedTLSVersionsToString[v] + `"`), nil
}

// UnmarshalJSON implements the json.Unmarshaler interface
func (v *TLSVersion) UnmarshalJSON(data []byte) error {
	var str string
	if err := StrictJSONUnmarshal(data, &str); err != nil {
		return err
	}
	if str == "" {
		*v = 0
		return nil
	}
	ver, ok := SupportedTLSVersions[str]
	if !ok {
		return fmt.Errorf("unknown TLS version '%s'", str)
	}
	*v = ver
	return nil
}

// Fields for TLSVersions. Unmarshalling hack.
type tlsVersionsFields struct {
	Min TLSVersion `json:"min" ignored:"true"` // Minimum allowed version, 0 = any.
	Max TLSVersion `json:"max" ignored:"true"` // Maximum allowed version, 0 = any.
}

// TLSVersions describes a set (min/max) of TLS versions.
type TLSVersions tlsVersionsFields

// UnmarshalJSON implements the json.Unmarshaler interface
func (v *TLSVersions) UnmarshalJSON(data []byte) error {
	var fields tlsVersionsFields
	if err := StrictJSONUnmarshal(data, &fields); err != nil {

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Use supported names such as tls1, tls1.1, tls1.2, tls1.3
  2. Check for typos in the sslAlpnProtocols/tlsVersion configuration
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/options.go:50 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/e45c1c9616b2cc84. Report an issue: GitHub.