summaryrefslogtreecommitdiff
path: root/modules/caddytls
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddytls')
-rw-r--r--modules/caddytls/acmeissuer.go4
-rw-r--r--modules/caddytls/connpolicy.go4
-rw-r--r--modules/caddytls/fileloader.go6
-rw-r--r--modules/caddytls/folderloader.go3
4 files changed, 8 insertions, 9 deletions
diff --git a/modules/caddytls/acmeissuer.go b/modules/caddytls/acmeissuer.go
index 9a7e73c..42cef02 100644
--- a/modules/caddytls/acmeissuer.go
+++ b/modules/caddytls/acmeissuer.go
@@ -18,8 +18,8 @@ import (
"context"
"crypto/x509"
"fmt"
- "io/ioutil"
"net/url"
+ "os"
"strconv"
"time"
@@ -152,7 +152,7 @@ func (iss *ACMEIssuer) Provision(ctx caddy.Context) error {
if len(iss.TrustedRootsPEMFiles) > 0 {
iss.rootPool = x509.NewCertPool()
for _, pemFile := range iss.TrustedRootsPEMFiles {
- pemData, err := ioutil.ReadFile(pemFile)
+ pemData, err := os.ReadFile(pemFile)
if err != nil {
return fmt.Errorf("loading trusted root CA's PEM file: %s: %v", pemFile, err)
}
diff --git a/modules/caddytls/connpolicy.go b/modules/caddytls/connpolicy.go
index 6c7fe3f..65cda5f 100644
--- a/modules/caddytls/connpolicy.go
+++ b/modules/caddytls/connpolicy.go
@@ -19,7 +19,7 @@ import (
"crypto/x509"
"encoding/base64"
"fmt"
- "io/ioutil"
+ "os"
"strings"
"github.com/caddyserver/caddy/v2"
@@ -369,7 +369,7 @@ func (clientauth *ClientAuthentication) ConfigureTLSConfig(cfg *tls.Config) erro
caPool.AddCert(clientCA)
}
for _, pemFile := range clientauth.TrustedCACertPEMFiles {
- pemContents, err := ioutil.ReadFile(pemFile)
+ pemContents, err := os.ReadFile(pemFile)
if err != nil {
return fmt.Errorf("reading %s: %v", pemFile, err)
}
diff --git a/modules/caddytls/fileloader.go b/modules/caddytls/fileloader.go
index fdf5486..430932b 100644
--- a/modules/caddytls/fileloader.go
+++ b/modules/caddytls/fileloader.go
@@ -17,7 +17,7 @@ package caddytls
import (
"crypto/tls"
"fmt"
- "io/ioutil"
+ "os"
"github.com/caddyserver/caddy/v2"
)
@@ -59,11 +59,11 @@ type CertKeyFilePair struct {
func (fl FileLoader) LoadCertificates() ([]Certificate, error) {
certs := make([]Certificate, 0, len(fl))
for _, pair := range fl {
- certData, err := ioutil.ReadFile(pair.Certificate)
+ certData, err := os.ReadFile(pair.Certificate)
if err != nil {
return nil, err
}
- keyData, err := ioutil.ReadFile(pair.Key)
+ keyData, err := os.ReadFile(pair.Key)
if err != nil {
return nil, err
}
diff --git a/modules/caddytls/folderloader.go b/modules/caddytls/folderloader.go
index 10b017e..0ff0629 100644
--- a/modules/caddytls/folderloader.go
+++ b/modules/caddytls/folderloader.go
@@ -19,7 +19,6 @@ import (
"crypto/tls"
"encoding/pem"
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"strings"
@@ -79,7 +78,7 @@ func (fl FolderLoader) LoadCertificates() ([]Certificate, error) {
}
func x509CertFromCertAndKeyPEMFile(fpath string) (tls.Certificate, error) {
- bundle, err := ioutil.ReadFile(fpath)
+ bundle, err := os.ReadFile(fpath)
if err != nil {
return tls.Certificate{}, err
}