Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion .github/CODEOWNERS

This file was deleted.

15 changes: 4 additions & 11 deletions astra/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"io"
"io/ioutil"
"net/http"
"runtime"
"time"

"github.com/datastax/astra-client-go/v2/astra"
Expand All @@ -53,10 +52,7 @@ func LoadBundleZip(reader *zip.Reader) (*Bundle, error) {
return nil, err
}

rootCAs, err := createCertPool()
if err != nil {
return nil, err
}
rootCAs := createCertPool()

ok := rootCAs.AppendCertsFromPEM(contents["ca.crt"])
if !ok {
Expand Down Expand Up @@ -200,10 +196,7 @@ func loadBytes(file *zip.File) ([]byte, error) {
return ioutil.ReadAll(r)
}

func createCertPool() (*x509.CertPool, error) {
ca, err := x509.SystemCertPool()
if err != nil && runtime.GOOS == "windows" {
return x509.NewCertPool(), nil
}
return ca, err

func createCertPool() *x509.CertPool {
return x509.NewCertPool()
}
5 changes: 1 addition & 4 deletions astra/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,7 @@ func runTestMetaSvcAsync(sniProxyAddr string, contactPoints []string) (*http.Ser
}

func createServerTLSConfig(dnsName string) (*tls.Config, error) {
rootCAs, err := createCertPool()
if err != nil {
return nil, err
}
rootCAs := createCertPool()

if !rootCAs.AppendCertsFromPEM(testCAPEM) {
return nil, errors.New("unable to add cert to CA pool")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/datastax/cql-proxy

go 1.24.2
go 1.19

require (
github.com/alecthomas/kong v0.2.17
Expand Down
4 changes: 2 additions & 2 deletions proxy/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func TestRun_ProxyTLS(t *testing.T) {
return checkLiveness(httpBindAddr)
}))

rootCAs, err := createCertPool()
rootCAs, err := createSystemCertPool()
require.NoError(t, err)

ok := rootCAs.AppendCertsFromPEM(testCAPEM)
Expand Down Expand Up @@ -720,7 +720,7 @@ func checkReadiness(t *testing.T, host string) (outage time.Duration, status int
return outage, res.StatusCode
}

func createCertPool() (*x509.CertPool, error) {
func createSystemCertPool() (*x509.CertPool, error) {
ca, err := x509.SystemCertPool()
if err != nil && runtime.GOOS == "windows" {
return x509.NewCertPool(), nil
Expand Down
Loading