mirror of
https://github.com/restic/restic.git
synced 2025-08-13 19:56:42 +00:00
http backend: Parse the correct argument when loading --tls-client-cert
Previously, the function read from ARGV[1] (hardcoded) rather than the value passed to it, the command-line argument as it exists in globalOptions. Resolves #1745
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user