Skip to content

Commit

Permalink
commands: Replace deprecated ioutil with os
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Jul 28, 2023
1 parent ef6e813 commit 2589b12
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions commands/server.go
Expand Up @@ -23,7 +23,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
Expand Down Expand Up @@ -686,9 +685,9 @@ func (c *serverCommand) createCertificates(conf *commonConfig) error {
c.tlsKeyFile = filepath.Join(keyDir, fmt.Sprintf("%s-key.pem", hostname))

// Check if the certificate already exists and is valid.
certPEM, err := ioutil.ReadFile(c.tlsCertFile)
certPEM, err := os.ReadFile(c.tlsCertFile)
if err == nil {
rootPem, err := ioutil.ReadFile(filepath.Join(mclib.GetCAROOT(), "rootCA.pem"))
rootPem, err := os.ReadFile(filepath.Join(mclib.GetCAROOT(), "rootCA.pem"))
if err == nil {
if err := c.verifyCert(rootPem, certPEM, hostname); err == nil {
c.r.Println("Using existing", c.tlsCertFile, "and", c.tlsKeyFile)
Expand Down

0 comments on commit 2589b12

Please sign in to comment.