mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 11:28:54 +00:00
Merge pull request #1746 from brycied00d/fix_tls-client-cert_argument_parsing
http backend: Parse the correct argument when loading --tls-client-cert
This commit is contained in:
commit
336719b058
7
changelog/unreleased/pull-1746
Normal file
7
changelog/unreleased/pull-1746
Normal file
@ -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
|
@ -7,7 +7,6 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -28,7 +27,7 @@ type TransportOptions struct {
|
|||||||
// readPEMCertKey reads a file and returns the PEM encoded certificate and key
|
// readPEMCertKey reads a file and returns the PEM encoded certificate and key
|
||||||
// blocks.
|
// blocks.
|
||||||
func readPEMCertKey(filename string) (certs []byte, key []byte, err error) {
|
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 {
|
if err != nil {
|
||||||
return nil, nil, errors.Wrap(err, "ReadFile")
|
return nil, nil, errors.Wrap(err, "ReadFile")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user