-
Notifications
You must be signed in to change notification settings - Fork 86
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
Support self-signed ca cert for backends #294
Conversation
pkg/cli/env.go
Outdated
@@ -52,6 +52,8 @@ const ( | |||
// For authentication based on tokens | |||
OS_STORAGE_URL = "OS_STORAGE_URL" | |||
OS_AUTH_TOKEN = "OS_AUTH_TOKEN" | |||
//For using certs in Mino server or REST server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo: Mino -> Minio
pkg/cli/restic.go
Outdated
|
||
func (w *ResticWrapper) getCertFile() (string, error) { | ||
certFile := w.scratchDir + "/cacerts/ca.crt" | ||
if _, err := os.Stat(certFile); os.IsExist(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be os.IsNotExist() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. Fixing.
pkg/cli/restic.go
Outdated
func (w *ResticWrapper) getCertFile() (string, error) { | ||
certFile := w.scratchDir + "/cacerts/ca.crt" | ||
if _, err := os.Stat(certFile); os.IsExist(err) { | ||
return "", errors.New(certFile + " not exist.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap original error
pkg/cli/restic.go
Outdated
@@ -46,14 +50,38 @@ type Snapshot struct { | |||
func (w *ResticWrapper) ListSnapshots() ([]Snapshot, error) { | |||
result := make([]Snapshot, 0) | |||
args := w.appendCacheDirFlag([]interface{}{"snapshots", "--json"}) | |||
if w.cacertEnabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a function w.appendCaCertFlag()
pkg/cli/restic.go
Outdated
@@ -151,3 +211,11 @@ func (w *ResticWrapper) appendCacheDirFlag(args []interface{}) []interface{} { | |||
} | |||
return append(args, "--no-cache") | |||
} | |||
|
|||
func (w *ResticWrapper) getCertFile() (string, error) { | |||
certFile := w.scratchDir + "/cacerts/ca.crt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use constant CertFilePath
624313e
to
4403d50
Compare
64206d8
to
5259f26
Compare
f2cccde
to
184791b
Compare
Fixes #288