Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ioutil and tls): Removed/replaced deprecated elements. #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions certutils/certutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"crypto/x509"
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
"time"
)

Expand All @@ -35,8 +35,6 @@ func NewTLSConfig(level TLSConfigLevel) *tls.Config {

switch level {
case TLSConfigIntermediate:
// Causes servers to use Go's default ciphersuite preferences, which are tuned to avoid attacks. Does nothing on clients.
c.PreferServerCipherSuites = true
// Only use curves which have assembly implementations
c.CurvePreferences = []tls.CurveID{
tls.CurveP256,
Expand Down Expand Up @@ -85,7 +83,6 @@ func NewTLSServer(config TLSServerConfig) *http.Server {
Addr: fmt.Sprintf("%s:%d", config.BindAddress, config.Port),
Handler: config.Router,
}
server.TLSConfig.BuildNameToCertificate()
return server
}

Expand All @@ -108,7 +105,7 @@ func LoadKeyCertFiles(keyFile, certFile string) (tls.Certificate, error) {
// and gives you back a proper x509.CertPool for your fun and proffit
func LoadCACertFile(cert string) (*x509.CertPool, error) {
// validate caCert, and setup certpool
ca, err := ioutil.ReadFile(cert)
ca, err := os.ReadFile(cert)
if err != nil {
return nil, fmt.Errorf("could not load CA Certificate: %s ", err.Error())
}
Expand Down
Loading