Skip to content

Commit 9c4db5c

Browse files
committed
kxd: Use standard representation for cert name
When logging certificate subject (for human reference), today we only print the organizational unit. That may be too brief for some certs, and make troubleshooting more difficult. This patch changes the logic to use the RFC 2253 standard representation for RDN sequences, which is much more comprehensive and common, while still being reasonably compact for logging purposes.
1 parent d638384 commit 9c4db5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kxd/kxd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ func (req *Request) KeyPath() (string, error) {
9393

9494
func certToString(cert *x509.Certificate) string {
9595
return fmt.Sprintf(
96-
"(0x%.8s ou:%s)",
96+
"(0x%.8s %s)",
9797
fmt.Sprintf("%x", cert.Signature),
98-
cert.Subject.OrganizationalUnit)
98+
cert.Subject.ToRDNSequence())
9999
}
100100

101101
// ChainToString makes a human-readable string out of the given certificate

0 commit comments

Comments
 (0)