Skip to content

[BUG] Using a long server name (>64) in Dashboard UI causes failure in generating server certificate and downloading startup kit #3508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Stifo opened this issue May 23, 2025 · 0 comments · May be fixed by #3509
Labels
bug Something isn't working

Comments

@Stifo
Copy link

Stifo commented May 23, 2025

Similar to #3093

Describe the bug
In NVFlare Dashboard, if using a server name longer than 64 characters, the certificate fails to generate as well as console and startup kit. The zip with Flare Console and the zip with Server Startup Kit cannot be downloaded.

Traceback

Traceback (most recent call last):
  File "/home/stevo/.pyenv/versions/3.9.19/envs/ai4os-nvflare-2.6.0/lib/python3.9/site-packages/nvflare/lighter/provisioner.py", line 110, in provision
    b.build(project, ctx)
  File "/home/stevo/.pyenv/versions/3.9.19/envs/ai4os-nvflare-2.6.0/lib/python3.9/site-packages/nvflare/lighter/impl/cert.py", line 246, in build
    self._build_write_cert_pair(server, CertFileBasename.SERVER, ctx)
  File "/home/stevo/.pyenv/versions/3.9.19/envs/ai4os-nvflare-2.6.0/lib/python3.9/site-packages/nvflare/lighter/impl/cert.py", line 176, in _build_write_cert_pair
    pri_key, cert = self.get_pri_key_cert(participant)
  File "/home/stevo/.pyenv/versions/3.9.19/envs/ai4os-nvflare-2.6.0/lib/python3.9/site-packages/nvflare/lighter/impl/cert.py", line 267, in get_pri_key_cert
    cert = self._generate_cert(
  File "/home/stevo/.pyenv/versions/3.9.19/envs/ai4os-nvflare-2.6.0/lib/python3.9/site-packages/nvflare/lighter/impl/cert.py", line 299, in _generate_cert
    return generate_cert(
  File "/home/stevo/.pyenv/versions/3.9.19/envs/ai4os-nvflare-2.6.0/lib/python3.9/site-packages/nvflare/lighter/utils.py", line 52, in generate_cert
    x509_subject = x509_name(subject.name, subject.org, subject.role)
  File "/home/stevo/.pyenv/versions/3.9.19/envs/ai4os-nvflare-2.6.0/lib/python3.9/site-packages/nvflare/lighter/utils.py", line 117, in x509_name
    name = [x509.NameAttribute(NameOID.COMMON_NAME, cn_name)]
  File "/home/stevo/.pyenv/versions/3.9.19/envs/ai4os-nvflare-2.6.0/lib/python3.9/site-packages/cryptography/x509/name.py", line 162, in __init__
    raise ValueError(msg)
ValueError: Attribute's length must be >= 1 and <= 64, but it was 78

To Reproduce
Steps to reproduce the behavior:

  1. Configure a project in NVFlare Dashboard UI.
  2. In Server Configuration screen, set the Server (DNS name) longer than 64 characters.
  3. Freeze project
  4. click Download FLARE Console
  5. click Dowload Server Startup Kit (primary)

Expected behavior
The requested zip file starts downloading.

Desktop (please complete the following information):

  • OS: [ubuntu 22.04]
  • Python Version [3.9.19]
  • NVFlare Version [2.6]
@Stifo Stifo added the bug Something isn't working label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant