Skip to content

Add a toggle to enable curve encryption for all kernels that support it#1638

Open
krassowski wants to merge 3 commits into
jupyter-server:mainfrom
krassowski:curve-encryption
Open

Add a toggle to enable curve encryption for all kernels that support it#1638
krassowski wants to merge 3 commits into
jupyter-server:mainfrom
krassowski:curve-encryption

Conversation

@krassowski
Copy link
Copy Markdown
Collaborator

@krassowski krassowski commented May 7, 2026

Exposes the proposed functionality from:

To test:

  1. Install ipykernel with PR 1515 and execute
    python -m ipykernel install --name zmq-encrypted --display-name 'ZMQ Encryption' --user
  2. Run jupyter-server with:
    jupyter lab --KernelManager.transport_encryption 'required'
  3. See that for kernels without encryption we get:
    image
  4. See that encrypted kernels work ok:
    image

Comment thread jupyter_server/services/kernels/kernelmanager.py Outdated
@krassowski
Copy link
Copy Markdown
Collaborator Author

In principle ready for review; I will follow with an end-to-end test, either here or in another PR (i..e once other PRs are merged and released), but beyond more tests I do not plan changes, unless requested in review.

Copy link
Copy Markdown
Contributor

@minrk minrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks simple and straightforward, nice! I think the only missing piece that we will need to enable this feature on a per-kernel basis. I think it makes sense to have a single flag to enable curve "when available" and may potentially want a case to require it (prohibit unencrypted kernel communication). So:

  1. curve disabled
  2. curve enabled on supporting kernels (still needs detection of support)
  3. curve required (unsupporting kernels cannot be launched)

So we still need a mechanism to detect if kernels support curve (could be a bool kernelspec field).

@ianthomas23
Copy link
Copy Markdown

So we still need a mechanism to detect if kernels support curve (could be a bool kernelspec field).

Perhaps in the supported_features (https://github.com/ipython/ipykernel/blob/912923542d55e6c80c0e7c1f94c648b52a225011/ipykernel/kernelbase.py#L997) from JEP 92?

@krassowski
Copy link
Copy Markdown
Collaborator Author

Are we thinking that three state string Enum (disabled, enabled, required) is a good choice to expose this? Or do folks prefer two Bools (which is nice but disabled + required does not make sense so should probably raise).

@krassowski
Copy link
Copy Markdown
Collaborator Author

Wouldn't supported_features be too late? This is emitted via kernel_info_reply but we need to know that before establishing the connection (so at the kernelspec level, the same as the debugger stanza in metadata originally before being moved to supported_features)?

@ianthomas23
Copy link
Copy Markdown

Wouldn't supported_features be too late? This is emitted via kernel_info_reply but we need to know that before establishing the connection (so at the kernelspec level, the same as the debugger stanza in metadata originally before being moved to supported_features)?

Yes, you are correct.

@Carreau Carreau added this to the 2.19 milestone May 28, 2026
@Carreau Carreau mentioned this pull request May 28, 2026
@krassowski
Copy link
Copy Markdown
Collaborator Author

Added the ability to require encryption in:

@Carreau Carreau modified the milestones: 2.19, 2.20 May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants