Skip to content

Commit

Permalink
enhance: crypto/tlsutil: use consistent function naming for `TLSCon…
Browse files Browse the repository at this point in the history
…fig.LoadX509KeyPair()`
  • Loading branch information
grokify committed Apr 7, 2024
1 parent 0ff2888 commit 14e2784
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crypto/tlsutil/tlsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func NewTLSConfig(certFilepath, keyFilepath string, rootCACertFilepaths, clientC
tc := &TLSConfig{Config: cfg}

if certFilepath != "" || keyFilepath != "" {
if err := tc.LoadServerKeyPair(certFilepath, keyFilepath); err != nil {
return nil, errorsutil.Wrapf(err, "err on LoadServerKeyPair (%s,%s)", certFilepath, keyFilepath)
if err := tc.LoadX509KeyPair(certFilepath, keyFilepath); err != nil {
return nil, errorsutil.Wrapf(err, "err on LoadX509KeyPair (%s,%s)", certFilepath, keyFilepath)
}
}
for _, rootCACertFilepath := range rootCACertFilepaths {
Expand All @@ -48,7 +48,7 @@ func NewTLSConfig(certFilepath, keyFilepath string, rootCACertFilepaths, clientC
return &TLSConfig{Config: cfg}, nil
}

func (tc *TLSConfig) LoadServerKeyPair(certFilepath, keyFilepath string) error {
func (tc *TLSConfig) LoadX509KeyPair(certFilepath, keyFilepath string) error {
if cert, err := tls.LoadX509KeyPair(certFilepath, keyFilepath); err != nil {
return errorsutil.Wrap(err, "err in LoadServerKeyPair")
} else {
Expand Down

0 comments on commit 14e2784

Please sign in to comment.