diff --git a/config/http_config.go b/config/http_config.go index 69c0b671..c07f696a 100644 --- a/config/http_config.go +++ b/config/http_config.go @@ -846,12 +846,12 @@ func (c *TLSConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { // readCertAndKey reads the cert and key files from the disk. func readCertAndKey(certFile, keyFile string) ([]byte, []byte, error) { - certData, err := ioutil.ReadFile(certFile) + certData, err := os.ReadFile(certFile) if err != nil { return nil, nil, err } - keyData, err := ioutil.ReadFile(keyFile) + keyData, err := os.ReadFile(keyFile) if err != nil { return nil, nil, err } diff --git a/config/http_config_test.go b/config/http_config_test.go index 036fd2dc..89594cd6 100644 --- a/config/http_config_test.go +++ b/config/http_config_test.go @@ -1536,7 +1536,7 @@ func TestOAuth2Proxy(t *testing.T) { func TestModifyTLSCertificates(t *testing.T) { bs := getCertificateBlobs(t) - tmpDir, err := ioutil.TempDir("", "modifytlscertificates") + tmpDir, err := os.MkdirTemp("", "modifytlscertificates") if err != nil { t.Fatal("Failed to create tmp dir", err) } @@ -1632,7 +1632,7 @@ func TestModifyTLSCertificates(t *testing.T) { t.Fatalf("Expected no error, got %q", err) } - b, err := ioutil.ReadAll(r.Body) + b, err := io.ReadAll(r.Body) r.Body.Close() if err != nil { t.Errorf("Can't read the server response body")