diff --git a/changelog/unreleased/pull-1746 b/changelog/unreleased/pull-1746 new file mode 100644 index 000000000..c909c9c80 --- /dev/null +++ b/changelog/unreleased/pull-1746 @@ -0,0 +1,7 @@ +Bugfix: Correctly parse the argument to --tls-client-cert + +Previously, the --tls-client-cert method attempt to read ARGV[1] (hardcoded) +instead of the argument that was passed to it. This has been corrected. + +https://github.com/restic/restic/issues/1745 +https://github.com/restic/restic/pull/1746 diff --git a/internal/backend/http_transport.go b/internal/backend/http_transport.go index 324874c63..30d25ba78 100644 --- a/internal/backend/http_transport.go +++ b/internal/backend/http_transport.go @@ -7,7 +7,6 @@ import ( "io/ioutil" "net" "net/http" - "os" "strings" "time" @@ -28,7 +27,7 @@ type TransportOptions struct { // readPEMCertKey reads a file and returns the PEM encoded certificate and key // blocks. func readPEMCertKey(filename string) (certs []byte, key []byte, err error) { - data, err := ioutil.ReadFile(os.Args[1]) + data, err := ioutil.ReadFile(filename) if err != nil { return nil, nil, errors.Wrap(err, "ReadFile") }