Files
zeekay 85f1a56714 Issue certificates under our own name
The defaults behind every certificate subject named upstream's
organization, a development unit and an invented city and state, so the
CAs, servers, clients and routers the bootstrap mints all carried them.
They now read O=Hanzo AI, OU=ZT, C=US and leave ST and L unset.

A router put an unset attribute into its CSR as an empty value, which
is not a DirectoryString (RFC 5280 4.1.2.4); it now leaves it out. And
`pki create` read the province from a key its flag was never bound to,
so --pki-province did nothing.

Claude-Session: https://claude.ai/code/session_01HuMDfgFssPUptYUzgZ6Cp8
2026-09-23 14:46:06 -07:00

14 lines
329 B
Go

package enroll
import (
"testing"
"github.com/hanzozt/zt/v2/router/env"
"github.com/stretchr/testify/require"
)
func TestCsrSubjectLeavesOutUnset(t *testing.T) {
c := &env.Csr{Country: "US", Organization: "Hanzo AI", OrganizationalUnit: "ZT"}
require.Equal(t, "CN=r,OU=ZT,O=Hanzo AI,C=US", csrSubject("r", c).String())
}