XTLS/Xray-core · error
uninitialized
Error message
uninitialized
What it means
State guard in ClientInstance.Handshake: NfsPKeys is nil, i.e. Init was never called (or failed) before attempting a handshake. The instance lacks server public keys, so the encrypted handshake cannot proceed; this signals skipped or failed initialization (e.g. an 'empty nfsPKeysBytes' path).
Solutions
- Ensure New/Init runs successfully before Handshake
- Check whether Init returned 'empty nfsPKeysBytes' or a padding parse error earlier
- Recreate the client instance with valid encryption configuration
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at proxy/vless/encryption/client.go:67 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15).
Data as JSON: /api/errors/5eb8f22453ae3d2e.
Report an issue: GitHub.
Appendix: source
Thrown at proxy/vless/encryption/client.go:67
}
i.RelaysLength += 32 + 32
} else {
if i.NfsPKeys[j], err = mlkem.NewEncapsulationKey768(k); err != nil {
return
}
i.RelaysLength += 1088 + 32
}
i.Hash32s[j] = blake3.Sum256(k)
}
i.RelaysLength -= 32
i.XorMode = xorMode
i.Seconds = seconds
return ParsePadding(padding, &i.PaddingLens, &i.PaddingGaps)
}
func (i *ClientInstance) Handshake(conn net.Conn) (*CommonConn, error) {
if i.NfsPKeys == nil {
return nil, errors.New("uninitialized")
}
c := NewCommonConn(conn, protocol.HasAESGCMHardwareSupport)
ivAndRealysLength := 16 + i.RelaysLength
pfsKeyExchangeLength := 18 + 1184 + 32 + 16
paddingLength, paddingLens, paddingGaps := CreatPadding(i.PaddingLens, i.PaddingGaps)
clientHello := make([]byte, ivAndRealysLength+pfsKeyExchangeLength+paddingLength)
iv := clientHello[:16]
rand.Read(iv)
relays := clientHello[16:ivAndRealysLength]
var nfsKey []byte
var lastCTR cipher.Stream
for j, k := range i.NfsPKeys {
index := 32
if k, ok := k.(*ecdh.PublicKey); ok {
privateKey, _ := ecdh.X25519().GenerateKey(rand.Reader)
copy(relays, privateKey.PublicKey().Bytes())View on GitHub (pinned to 7d214f8b09)