Skip to content

Commit bebc731

Browse files
author
Julien Pivotto
authored
Remove ioutil after merging check client certificates (#407)
Signed-off-by: Julien Pivotto <[email protected]> Signed-off-by: Julien Pivotto <[email protected]>
1 parent 8c9cb3f commit bebc731

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

config/http_config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,12 +846,12 @@ func (c *TLSConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
846846

847847
// readCertAndKey reads the cert and key files from the disk.
848848
func readCertAndKey(certFile, keyFile string) ([]byte, []byte, error) {
849-
certData, err := ioutil.ReadFile(certFile)
849+
certData, err := os.ReadFile(certFile)
850850
if err != nil {
851851
return nil, nil, err
852852
}
853853

854-
keyData, err := ioutil.ReadFile(keyFile)
854+
keyData, err := os.ReadFile(keyFile)
855855
if err != nil {
856856
return nil, nil, err
857857
}

config/http_config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ func TestOAuth2Proxy(t *testing.T) {
15361536
func TestModifyTLSCertificates(t *testing.T) {
15371537
bs := getCertificateBlobs(t)
15381538

1539-
tmpDir, err := ioutil.TempDir("", "modifytlscertificates")
1539+
tmpDir, err := os.MkdirTemp("", "modifytlscertificates")
15401540
if err != nil {
15411541
t.Fatal("Failed to create tmp dir", err)
15421542
}
@@ -1632,7 +1632,7 @@ func TestModifyTLSCertificates(t *testing.T) {
16321632
t.Fatalf("Expected no error, got %q", err)
16331633
}
16341634

1635-
b, err := ioutil.ReadAll(r.Body)
1635+
b, err := io.ReadAll(r.Body)
16361636
r.Body.Close()
16371637
if err != nil {
16381638
t.Errorf("Can't read the server response body")

0 commit comments

Comments
 (0)