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

Fix #52 conjur logon fail #54

Merged
merged 7 commits into from
Jan 27, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add --self-signed flag to conjur logon
  • Loading branch information
AndrewCopeland committed Jan 20, 2021
commit 453ebeccacbefee7ee2d5f9294abfd222607a9fb
10 changes: 8 additions & 2 deletions cmd/conjur.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,14 @@ var conjurLogonCmd = &cobra.Command{
}

netrcPath := fmt.Sprintf("%s/.netrc", homeDir)
certPath := fmt.Sprintf("%s/conjur-%s.pem", homeDir, Account)

err = conjur.CreateConjurRc(Account, BaseURL)
// certPath remains empty if not using self-signed-cert
certPath := ""
if InsecureTLS {
certPath = fmt.Sprintf("%s/conjur-%s.pem", homeDir, Account)
}

err = conjur.CreateConjurRc(Account, BaseURL, InsecureTLS)
if err != nil {
log.Fatalf("Failed to create ~/.conjurrc file. %s\n", err)
}
Expand Down Expand Up @@ -391,6 +396,7 @@ func init() {
conjurLogonCmd.MarkFlagRequired("account")
conjurLogonCmd.Flags().StringVarP(&BaseURL, "base-url", "b", "", "Conjur appliance URL")
conjurLogonCmd.MarkFlagRequired("base-url")
conjurLogonCmd.Flags().BoolVar(&InsecureTLS, "self-signed", false, "Retrieve and use self-signed certificate when sending requests to the Conjur API")

// append-policy
conjurAppendPolicyCmd.Flags().StringVarP(&PolicyBranch, "branch", "b", "", "The policy branch in which policy is being loaded")
Expand Down