commit 5a17113683d0c1d1c33995812a4a8af2e08fd7bd Author: Travis Raines Date: Thu May 6 16:57:42 2021 -0700 fix: include SNIs in certificate objects diff --git a/dump/dump.go b/dump/dump.go index abdc222..33d3350 100644 --- a/dump/dump.go +++ b/dump/dump.go @@ -344,11 +344,7 @@ func GetAllCertificates(ctx context.Context, client *kong.Client, if err := ctx.Err(); err != nil { return nil, err } - for _, cert := range s { - c := cert - c.SNIs = nil - certificates = append(certificates, cert) - } + certificates = append(certificates, s...) if nextopt == nil { break } diff --git a/file/builder.go b/file/builder.go index 7094a20..9831666 100644 --- a/file/builder.go +++ b/file/builder.go @@ -90,12 +90,17 @@ func (b *stateBuilder) certificates() { utils.MustMergeTags(&c, b.selectTags) snisFromCert := c.SNIs + sniNames := make([]*string, 0) + for _, s := range c.SNIs { + sniNames = append(sniNames, s.Name) + } kongCert := kong.Certificate{ ID: c.ID, Key: c.Key, Cert: c.Cert, Tags: c.Tags, + SNIs: sniNames, CreatedAt: c.CreatedAt, } b.rawState.Certificates = append(b.rawState.Certificates, &kongCert)