Skip to content

Add --cacert option to provide custom CA certificate#50

Open
rockbox-y1 wants to merge 1 commit intoameshkov:masterfrom
rockbox-y1:cacert-option
Open

Add --cacert option to provide custom CA certificate#50
rockbox-y1 wants to merge 1 commit intoameshkov:masterfrom
rockbox-y1:cacert-option

Conversation

@rockbox-y1
Copy link
Copy Markdown

This adds functionality to supply your own CA certificate as in curl. E.g. for testing internal services that are signed with custom CAs.

Thanks for your work and let me know if anything is missing.

Copy link
Copy Markdown
Owner

@ameshkov ameshkov left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

Please fix a couple of comments and please add a test to https://github.com/ameshkov/gocurl/blob/master/internal/cmd/cmd_test.go

Also, it becomes possible to run HTTP/3 test without --insecure

Insecure bool `short:"k" long:"insecure" description:"Disables TLS verification of the connection." optional:"yes" optional-value:"true"`

// Provide your own CA certificates
CACert string `long:"cacert" description:"Path to custom CA certificate file." value-name:"<file>"`
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please elaborate a little in the description

Suggested change
CACert string `long:"cacert" description:"Path to custom CA certificate file." value-name:"<file>"`
CACert string `long:"cacert" description:"Path to a certificate file to verify the peer. The file may contain multiple CA certificates. The certificate(s) must be in PEM format." value-name:"<file>"`

Comment thread README.md
--connect-timeout=<seconds> Maximum time in seconds allowed for the connection phase.
-I, --head Fetch the headers only.
-k, --insecure Disables TLS verification of the connection.
--cacert=<file> Path to custom CA
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This will also have to be updated (just run gocurl --help and copy/paste)

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.

2 participants