caddyserver / caddyserver/website

The documentation could make it more straightforward to use a custom root + intermediate certificate

Open
#516 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
227
Forks
213
Avg merge
3h 52m
Merged PRs (30d)
1

Description

Issue Details

After piecing things together from the docs, plus a bit of luck (see root key note below), this can be accomplished, but took more time to discover how than anticipated.

The use-case is that I want to give Caddy a custom intermediate to sign with, but without exposing the root cert key. Config to accomplish:

{
        # ...
        pki {
                ca foo {
                        root {
                                format pem_file
                                cert /var/certs/root-ca.crt
                                # We don't actually have a root key, nor do we
                                # want to make caddy use one... so pass a bogus
                                # one (it seems it won't be used).
                                # Too bad this arg is required.
                                key /var/certs/sub-ca.key
                        }
                        intermediate {
                                format pem_file
                                cert /var/certs/sub-ca.crt
                                key /var/certs/sub-ca.key
                        }
                }
        }
}

my.domain {
        # It seems that using 'tls internal' and calling the pki ca 'local'
        # won't actually work. So let's use an explicitly named internal ca.
        # Maybe 'local' would have worked with the expanded 'issuer'-y tls
        # config, not sure.
        tls {
                issuer internal {
                        ca foo
                }
        }
        # ...
}

Works great otherwise!

(Sidenote - this also allows one to generate custom name constraints, which was also pondered in https://github.com/caddyserver/caddy/issues/5759. See https://www.feistyduck.com/library/openssl-cookbook/online/ section 1.5)

Assistance Disclosure

AI not used

If AI was used, describe the extent to which it was used.

I rather keep my mind exercised, and rely on discovering quality expert material to subscribe to, rather than use LLMs.

Contributor guide

No contributing guide indexed for this repository

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

The issue names no repository file, test, or documentation entry point; begin by locating the PKI root/intermediate and internal issuer documentation using the supplied configuration example and linked Caddy issue. Done means the documented path for using a custom intermediate without exposing the root key is easier to discover and explains the relevant configuration.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.