mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-10 19:51:55 +00:00
Check error return from closing connection
Kubernetes-commit: 7bafa7d8f54326b69d41c92793eaa641d3a5b31b
This commit is contained in:
parent
050872ffe7
commit
a4893d5271
@ -19,6 +19,7 @@ package cert
|
||||
import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
@ -43,7 +44,9 @@ func GetClientCANames(apiHost string) ([]string, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer conn.Close()
|
||||
if err := conn.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return acceptableCAs, nil
|
||||
}
|
||||
@ -72,7 +75,9 @@ func GetServingCertificates(apiHost, serverName string) ([]*x509.Certificate, []
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
conn.Close()
|
||||
if err = conn.Close(); err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to close connection : %v", err)
|
||||
}
|
||||
|
||||
peerCerts := conn.ConnectionState().PeerCertificates
|
||||
peerCertBytes := [][]byte{}
|
||||
|
Loading…
Reference in New Issue
Block a user