oxidecomputer / oxidecomputer/omicron

Bad TLS cert error messages could be more helpful

Open
#4,237 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

Low priority because the experience is pretty tolerable. You can figure it out with some effort.

Hitting silo create with a bad request body (cert: 'Hello\n') results in the following error message. But there is no certificate field (it's cert). Also, the body contains an array of certs and this error doesn't tell you which one has the error. It blows up on the first bad one.

Unsupported value for "certificate": Certificate exists, but is empty.

The request looked like this:

image

Relevant code

https://github.com/oxidecomputer/omicron/blob/47a6b42c986c65292ee61b0c79090fa57dec5fe9/certificates/src/lib.rs#L24-L25

https://github.com/oxidecomputer/omicron/blob/47a6b42c986c65292ee61b0c79090fa57dec5fe9/nexus/db-model/src/certificate.rs#L42-L59

https://github.com/oxidecomputer/omicron/blob/47a6b42c986c65292ee61b0c79090fa57dec5fe9/nexus/db-queries/src/db/datastore/silo.rs#L235-L248

Contributor guide

Open the contributing guide

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.

Research direction

Start with certificates/src/lib.rs, nexus/db-model/src/certificate.rs, and nexus/db-queries/src/db/datastore/silo.rs, especially the linked lines, then reproduce silo creation with the bad cert request body. Done means the error refers to the cert field and identifies which certificate in the array is invalid.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.