matryer / silk

Markdown based document-driven RESTful API testing.
http://silktest.org/
GNU General Public License v2.0
942 stars 69 forks source link

x509: certificate signed by unknown authority #50

Open juacompe opened 6 years ago

juacompe commented 6 years ago

When I'm running silk against certificate signed by untrusted root, I got the following error.

> silk -silk.url="https://untrusted-root.badssl.com/" ./**/*.silk.md
silk: running 1 file(s)...
x509: certificate signed by unknown authority
--- FAIL: silk (0.67s)
FAIL

I tried to find a way to skip certification checking in help but couldn't find it. (like option -k in curl)

 -k, --insecure      Allow connections to SSL sites without certs (H)

I think the error was caused by http.DefaultTransport used in Runner.DoRequest. It seems to me that DefaultTransport does not allow a connection to insecure SSL sites.

https://github.com/matryer/silk/blob/11c4f5465bf617bd7ff879e7e243c9180ca35528/runner/run.go#L56

I found a way to skip it here https://groups.google.com/d/msg/golang-nuts/v5ShM8R7Tdc/I2wyTy1o118J

I'm thinking of adding another option in silk to allow connections to SSL sites without certs. Any idea what the option should be? Is -k ok?