Support multiple DnValue per key in DistinguishedName

Open
#81 2 comments 2 reactions 0 assignees View on GitHub

@djc is already working on this.

Since Nov 17, 2025.

  • #394 by @djc — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
security

Research direction

Start at the DistinguishedName::push entry point shown in the issue and trace how repeated OrganizationalUnitName values are stored and rendered. Done means successive pushes preserve all OU values so the generated subject contains each requested key-value pair.

Written by the indexing model from the issue text.

Description

I need to generate a certificate with a subject line containing multiple OU key-value pairs:

Subject: OU=certtype:instance, OU=compartment:compartment, OU=instance:instance

The problem is subsequent calls to DistinguishedName::push overwrite the previous value:

params.distinguished_name.push(DnType::OrganizationalUnitName, format!("certtype:{}", certtype));
params.distinguished_name.push(DnType::OrganizationalUnitName, format!("compartment:{}", compartment));
params.distinguished_name.push(DnType::OrganizationalUnitName, format!("instance:{}", instance));

This leaves me with a subject containing only the last value:

Subject: OU=instance:instance
Dominant language
Rust
Stars
516
Forks
160
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rustls/rcgen

All issues in rustls/rcgen

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.