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

Support self-signed ca cert for backends #294

Merged
merged 16 commits into from
Feb 3, 2018
Merged

Support self-signed ca cert for backends #294

merged 16 commits into from
Feb 3, 2018

Conversation

hossainemruz
Copy link
Contributor

@hossainemruz hossainemruz commented Jan 24, 2018

Fixes #288

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typo: Mino -> Minio


func (w *ResticWrapper) getCertFile() (string, error) {
certFile := w.scratchDir + "/cacerts/ca.crt"
if _, err := os.Stat(certFile); os.IsExist(err) {
Copy link
Contributor

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() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. Fixing.

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.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrap original error

@@ -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 {
Copy link
Contributor

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()

@@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use constant CertFilePath

@tamalsaha tamalsaha force-pushed the master branch 3 times, most recently from 624313e to 4403d50 Compare January 27, 2018 13:57
@tamalsaha tamalsaha force-pushed the cacerts branch 5 times, most recently from 64206d8 to 5259f26 Compare January 31, 2018 01:49
@tamalsaha tamalsaha changed the title CACERT implemented for minio server. Support self-signed ca cert for backends Jan 31, 2018
@tamalsaha tamalsaha force-pushed the cacerts branch 2 times, most recently from f2cccde to 184791b Compare February 3, 2018 05:18
@tamalsaha tamalsaha merged commit b5d67a6 into master Feb 3, 2018
@tamalsaha tamalsaha deleted the cacerts branch February 3, 2018 05:34
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

Successfully merging this pull request may close these issues.

3 participants