Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions gnmi_server/clientCertAuth.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,14 @@ func ClientCertAuthenAndAuthor(ctx context.Context, serviceConfigTableName strin
func TryDownload(url string) bool {
glog.Infof("Download CRL start: %s", url)
resp, err := http.Get(url)

if resp != nil {
defer resp.Body.Close()
if err != nil {
glog.Infof("Download CRL: %s failed: %v", url, err)
return false
}
defer resp.Body.Close()

if err != nil || resp.StatusCode != http.StatusOK {
glog.Infof("Download CRL: %s failed: %v", url, err)
if resp.StatusCode != http.StatusOK {
glog.Infof("Download CRL: %s failed: HTTP %d", url, resp.StatusCode)
return false
}

Expand Down
Loading