diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2021-10-13 22:38:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-13 22:38:58 -0700 |
| commit | 5fd4b05c5ef2de1d49bfa35d42d4ac4f3bc9b068 (patch) | |
| tree | bb21b4450e8611eed89d33dfdd46e4e6144bc00b /weed/security/tls.go | |
| parent | 46a09c60744eff104fdfc1a1fade38c5485f0dda (diff) | |
| parent | a23bcbb7ecf93fcda35976f4f2fb42a67830e718 (diff) | |
| download | seaweedfs-5fd4b05c5ef2de1d49bfa35d42d4ac4f3bc9b068.tar.xz seaweedfs-5fd4b05c5ef2de1d49bfa35d42d4ac4f3bc9b068.zip | |
Merge pull request #2381 from Juneezee/deprecate-ioutil
refactor: move from io/ioutil to io and os package
Diffstat (limited to 'weed/security/tls.go')
| -rw-r--r-- | weed/security/tls.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/weed/security/tls.go b/weed/security/tls.go index 7d3ffcdca..2f01af1e7 100644 --- a/weed/security/tls.go +++ b/weed/security/tls.go @@ -4,18 +4,18 @@ import ( "context" "crypto/tls" "crypto/x509" - "github.com/chrislusf/seaweedfs/weed/util" - grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/peer" - "google.golang.org/grpc/status" - "io/ioutil" + "os" "strings" + grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth" "google.golang.org/grpc" + "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/status" "github.com/chrislusf/seaweedfs/weed/glog" + "github.com/chrislusf/seaweedfs/weed/util" ) type Authenticator struct { @@ -37,7 +37,7 @@ func LoadServerTLS(config *util.ViperProxy, component string) (grpc.ServerOption err) return nil, nil } - caCert, err := ioutil.ReadFile(config.GetString("grpc.ca")) + caCert, err := os.ReadFile(config.GetString("grpc.ca")) if err != nil { glog.V(1).Infof("read ca cert file %s error: %v", config.GetString("grpc.ca"), err) return nil, nil @@ -82,7 +82,7 @@ func LoadClientTLS(config *util.ViperProxy, component string) grpc.DialOption { glog.V(1).Infof("load cert/key error: %v", err) return grpc.WithInsecure() } - caCert, err := ioutil.ReadFile(caFileName) + caCert, err := os.ReadFile(caFileName) if err != nil { glog.V(1).Infof("read ca cert file error: %v", err) return grpc.WithInsecure() |
