grafana/k6 · error
unknown cipher suite id '%d'
Error message
unknown cipher suite id '%d'
What it means
Raised by TLSCipherSuites.MarshalJSON when serializing the configured cipher list: a numeric cipher suite ID in the options has no entry in SupportedTLSCipherSuitesToString, so it cannot be rendered as a name. Typically the result of programmatically set or stale options containing an unknown suite constant.
Source
Thrown at lib/options.go:91
fields.Min = ver
fields.Max = ver
}
*v = TLSVersions(fields)
return nil
}
// TLSCipherSuites represents a list of TLS cipher suites.
// Marshals and unmarshals from a list of names, eg. "TLS_ECDHE_RSA_WITH_RC4_128_SHA".
type TLSCipherSuites []uint16
// MarshalJSON will return the JSON representation according to supported TLS cipher suites
func (s *TLSCipherSuites) MarshalJSON() ([]byte, error) {
var suiteNames []string
for _, id := range *s {
if suiteName, ok := SupportedTLSCipherSuitesToString[id]; ok {
suiteNames = append(suiteNames, suiteName)
} else {
return nil, fmt.Errorf("unknown cipher suite id '%d'", id)
}
}
return json.Marshal(suiteNames)
}
// UnmarshalJSON implements the json.Unmarshaler interface
func (s *TLSCipherSuites) UnmarshalJSON(data []byte) error {
var suiteNames []string
if err := StrictJSONUnmarshal(data, &suiteNames); err != nil {
return err
}
var suiteIDs []uint16
for _, name := range suiteNames {
if suiteID, ok := SupportedTLSCipherSuites[name]; ok {
suiteIDs = append(suiteIDs, suiteID)
} else {View on GitHub (pinned to 01ffac6f24)
Solutions
- Use only cipher suite names from Go's crypto/tls supported list (e.g. TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256)
- Avoid injecting raw numeric cipher IDs into options
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/options.go:91 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18).
Data as JSON: /api/errors/77caa8b8cd2ccc6f.
Report an issue: GitHub.