Skip to content

Commit

Permalink
Commands: Use ".crt" & ".key" suffixes when generating TLS certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
RPRX committed Feb 8, 2025
1 parent 613c63b commit 925a985
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion common/protocol/tls/cert/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.pem
*.crt
*.key
4 changes: 2 additions & 2 deletions common/protocol/tls/cert/cert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func printJSON(certificate *Certificate) {
func printFile(certificate *Certificate, name string) error {
certPEM, keyPEM := certificate.ToPEM()
return task.Run(context.Background(), func() error {
return writeFile(certPEM, name+"_cert.pem")
return writeFile(certPEM, name+".crt")
}, func() error {
return writeFile(keyPEM, name+"_key.pem")
return writeFile(keyPEM, name+".key")
})
}

Expand Down
4 changes: 2 additions & 2 deletions main/commands/all/tls/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ func writeFile(content []byte, name string) error {
func printFile(certificate *cert.Certificate, name string) error {
certPEM, keyPEM := certificate.ToPEM()
return task.Run(context.Background(), func() error {
return writeFile(certPEM, name+"_cert.pem")
return writeFile(certPEM, name+".crt")
}, func() error {
return writeFile(keyPEM, name+"_key.pem")
return writeFile(keyPEM, name+".key")
})
}

Expand Down

0 comments on commit 925a985

Please sign in to comment.