replace deprecated method
This commit is contained in:
@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/go-gost/core/auth"
|
||||
"golang.org/x/crypto/ssh"
|
||||
@ -58,7 +58,7 @@ func PublicKeyCallback(keys map[string]bool) PublicKeyCallbackFunc {
|
||||
|
||||
// ParseSSHAuthorizedKeysFile parses ssh authorized keys file.
|
||||
func ParseAuthorizedKeysFile(name string) (map[string]bool, error) {
|
||||
authorizedKeysBytes, err := ioutil.ReadFile(name)
|
||||
authorizedKeysBytes, err := os.ReadFile(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/go-gost/core/logger"
|
||||
@ -114,7 +114,7 @@ func loadCA(caFile string) (cp *x509.CertPool, err error) {
|
||||
return
|
||||
}
|
||||
cp = x509.NewCertPool()
|
||||
data, err := ioutil.ReadFile(caFile)
|
||||
data, err := os.ReadFile(caFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user