mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-28 11:41:49 +00:00
Merge pull request #85284 from yutedz/svr-check-close-ret
Check error return from closing connection Kubernetes-commit: e3eeb7e2f000b3d51e856a1862a4fef249b6708c
This commit is contained in:
commit
debe729c79
@ -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