Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ioutil after merging check client certificates #407

Merged
merged 1 commit into from Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/http_config.go
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions config/http_config_test.go
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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")
Expand Down