You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
E2EE: EncodeError when connecting with encryption enabled #606
When connecting with E2EE enabled via E2EEOptions(key_provider_options=KeyProviderOptions(shared_key=...)), the connect call fails with a protobuf EncodeError.
The cause appears to be that key_ring_size and key_derivation_function on the KeyProviderOptions proto message are never populated. They're required fields in the proto2 schema but aren't exposed on the Python KeyProviderOptions dataclass and aren't set in room.py's connect() method.
This affects both the options.e2ee and options.encryption code paths.
We're currently working around this by monkey-patching the FFI request to set defaults before it's sent.
from livekit.rtc._ffi_client import FfiClient
from livekit.rtc._proto import ffi_pb2 as _proto_ffi
_original_ffi_request = FfiClient.request
def _patched_ffi_request(
self: FfiClient, req: _proto_ffi.FfiRequest
) -> _proto_ffi.FfiResponse:
if req.HasField("connect"):
for field_name in ("encryption", "e2ee"):
if req.connect.options.HasField(field_name):
kpo = getattr(req.connect.options, field_name).key_provider_options
if not kpo.key_ring_size:
kpo.key_ring_size = 16
if not kpo.key_derivation_function:
kpo.key_derivation_function = 0
return _original_ffi_request(self, req)
FfiClient.request = _patched_ffi_request # type: ignore[assignment]
Activity
trippyogi commentedon Jul 16, 2026
This appears fixed by #628 (merge commit
1dfb135).That PR sets the required protobuf fields that were missing on
KeyProviderOptions:key_ring_size(default16)key_derivation_function(defaultPBKDF2)Both
options.e2eeandoptions.encryptionpaths inRoom.connect()now copy these fields. The fix first shipped inlivekit-rtcrtc-v1.1.6.If maintainers agree, please close this issue. Happy to provide more detail if needed.