Skip to content

Commit

Permalink
improve: use k3s tls secret field name to load ca cert
Browse files Browse the repository at this point in the history
  • Loading branch information
Mmx233 committed Apr 4, 2024
1 parent 3ec6125 commit 9aa9e8c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/global/keypair.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import (
)

const (
_PublicCrtName = "cert.crt"
_PublicKeyName = "public.pem"
_PrivateKeyName = "private.pem"

_PublicTlsKeyName = "tls.crt"
_PrivateTlsKeyName = "tls.key"

dirJwt = "jwt"
dirCa = "ca"
)
Expand All @@ -38,11 +40,11 @@ func initCaIssuer() {
var loader = ed25519Pkg.Loader{
Dir: path.Join(ConfigDir, dirCa),
}
certBytes, err := loader.LoadPem(_PublicCrtName)
certBytes, err := loader.LoadPem(_PublicTlsKeyName)
if err != nil {
log.Fatalln("read ca cert failed:", err)
}
keyBytes, err := loader.LoadPem(_PrivateKeyName)
keyBytes, err := loader.LoadPem(_PrivateTlsKeyName)
if err != nil {
log.Fatalln("read ca key failed:", err)
}
Expand Down

0 comments on commit 9aa9e8c

Please sign in to comment.