mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
commands: Replace deprecated ioutil with os
This commit is contained in:
parent
ef6e813ca8
commit
2589b1295c
1 changed files with 2 additions and 3 deletions
|
@ -23,7 +23,6 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
@ -686,9 +685,9 @@ func (c *serverCommand) createCertificates(conf *commonConfig) error {
|
||||||
c.tlsKeyFile = filepath.Join(keyDir, fmt.Sprintf("%s-key.pem", hostname))
|
c.tlsKeyFile = filepath.Join(keyDir, fmt.Sprintf("%s-key.pem", hostname))
|
||||||
|
|
||||||
// Check if the certificate already exists and is valid.
|
// Check if the certificate already exists and is valid.
|
||||||
certPEM, err := ioutil.ReadFile(c.tlsCertFile)
|
certPEM, err := os.ReadFile(c.tlsCertFile)
|
||||||
if err == nil {
|
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 == nil {
|
||||||
if err := c.verifyCert(rootPem, certPEM, hostname); err == nil {
|
if err := c.verifyCert(rootPem, certPEM, hostname); err == nil {
|
||||||
c.r.Println("Using existing", c.tlsCertFile, "and", c.tlsKeyFile)
|
c.r.Println("Using existing", c.tlsCertFile, "and", c.tlsKeyFile)
|
||||||
|
|
Loading…
Reference in a new issue