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

HTTP Backend unable to load TLS client certificates #1745

Closed
brycied00d opened this issue Apr 30, 2018 · 1 comment
Closed

HTTP Backend unable to load TLS client certificates #1745

brycied00d opened this issue Apr 30, 2018 · 1 comment
Milestone

Comments

@brycied00d
Copy link
Contributor

brycied00d commented Apr 30, 2018

The --tls-client-cert option introduced by #1524 (in response to #1522) has a fatal flaw that causes it to attempt to read the value of ARGV[1] rather than the function argument, failing.

Output of restic version

restic 0.8.3
compiled with go1.10.1 on linux/amd64

How did you run restic exactly?

restic --tls-client-cert ./test.pem -r rest:https://my.server/restic/test snapshots

open --tls-client-cert: no such file or directory
ReadFile
github.com/restic/restic/internal/backend.readPEMCertKey
	/build/restic/src/src/github.com/restic/restic/internal/backend/http_transport.go:33
github.com/restic/restic/internal/backend.Transport
	/build/restic/src/src/github.com/restic/restic/internal/backend/http_transport.go:83
main.open
	/build/restic/src/restic-0.8.3/cmd/restic/global.go:550
main.OpenRepository
	/build/restic/src/restic-0.8.3/cmd/restic/global.go:328
main.runList
	/build/restic/src/restic-0.8.3/cmd/restic/cmd_list.go:34
main.glob..func12
	/build/restic/src/restic-0.8.3/cmd/restic/cmd_list.go:21
github.com/spf13/cobra.(*Command).execute
	/build/restic/src/src/github.com/spf13/cobra/command.go:698
github.com/spf13/cobra.(*Command).ExecuteC
	/build/restic/src/src/github.com/spf13/cobra/command.go:783
github.com/spf13/cobra.(*Command).Execute
	/build/restic/src/src/github.com/spf13/cobra/command.go:736
main.main
	/build/restic/src/restic-0.8.3/cmd/restic/main.go:69
runtime.main
	/usr/lib/go/src/runtime/proc.go:198
runtime.goexit
	/usr/lib/go/src/runtime/asm_amd64.s:2361

What backend/server/service did you use to store the repository?

No pre-existing repository is required, however you must pass a backend argument that would use the HTTP backend.

Expected behavior

I expected it to read the file ./test.pem

Actual behavior

It attempted to read a file named --tls-client-cert

Steps to reproduce the behavior

No advanced setup, you don't even need to have a certificate file or backend configured. Simply running restic --tls-client-cert somefile -r rest:https://somewhere snapshots is enough.

Do you have any idea what may have caused this?

Yes. (c34db98)

Do you have an idea how to solve the issue?

Yes

Did restic help you or made you happy in any way?

Always. Although overlooking silly mistakes like this makes me sad.

brycied00d added a commit to brycied00d/restic that referenced this issue Apr 30, 2018
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 restic#1745
@fd0 fd0 added this to the 0.9.0 milestone May 1, 2018
@fd0
Copy link
Member

fd0 commented May 1, 2018

Awesome, thank you very much!

@fd0 fd0 closed this as completed in #1746 May 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants