hyperledger-firefly / hyperledger-firefly/fabconnect

/identities enroll generates incomplete certificate Subject (missing C, ST, O, etc)

Open
#132 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
40
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Hi maintainers,

I'm using `firefly-fabconnect v0.9.23` and encountered an issue when enrolling a new identity using the `/identities` API.

---

### 🧪 Context

I registered and enrolled a client identity `"alextest3"` using the following endpoint:

```
POST /identities
```

The resulting certificate was generated successfully, but when inspected with `openssl`, the `Subject` field was **incomplete**:

```bash
openssl x509 -noout -text -in alextest3@FactoryDevMSP-cert.pem
```

**Resulting Subject (via Fabconnect):**
```
OU = org1 + OU = client + OU = department1, CN = alextest3
```

By contrast, when I use the `fabric-ca-client` CLI to enroll a similar identity, the certificate includes the full Subject information:

**Resulting Subject (via fabric-ca-client):**
```
C = TW, ST = Taiwan, O = factory.22.dev, OU = client, CN = user1@factory.22.dev
```

---

### 📌 Problem

The certificate issued via Fabconnect appears to have **missing Distinguished Name (DN)** fields such as:

- `C` (Country)
- `ST` (State)
- `O` (Organization)
- `OU` (single Organizational Unit)

Only multiple `OU` fields appear to be injected from attributes.

---

### 💡 What I'm trying to achieve

I would like to generate a certificate through Fabconnect's `/identities` API that includes a full Subject DN, just like what `fabric-ca-client` allows when using `--csr.names`.

---

### ❓Questions

1. Is there any supported way to customize the CSR or Subject fields via Fabconnect?
2. Does Fabconnect support forwarding custom CSR data (like `csr.names`) to the Fabric CA server?
3. If not currently supported, is there a recommended workaround or roadmap item for this?

---

### 🔗 References

- [firefly-fabconnect v0.9.23](https://github.com/hyperledger/firefly-fabconnect/tree/v0.9.23)
- [Fabric CA Enroll CSR Options](https://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html#certificate-signing-request)

---

Thanks for your help and great work on the project!

Best regards,
@cshuangtw

Contributor guide

Open the contributing guide

Research direction

Start with the POST /identities enrollment flow and compare its certificate CSR handling with the Fabric CA Enroll CSR Options referenced in the issue. Use openssl to inspect generated certificates and verify that supported custom CSR data, including C, ST, O, and OU subject fields, is reflected in the resulting Subject.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.