Skip to content

Commit

Permalink
Adding IgnoreSSLVerify option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan GAZEAU committed Apr 1, 2019
1 parent 4b5831f commit 30138c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ htmltest uses a YAML configuration file. Put `.htmltest.yml` in the same directo
| `IgnoreCanonicalBrokenLinks` | When true produces a warning, rather than an error, for broken canonical links. When testing a site which isn't live yet or before publishing a new page canonical links will fail. | `true` |
| `IgnoreAltMissing` | Turns off image alt attribute checking. | `false` |
| `IgnoreDirectoryMissingTrailingSlash` | Turns off errors for links to directories without a trailing slash. | `false` |
| `IgnoreSSLVerify` | Turns off x509 errors for self-signed certificates. | `false` |
| `IgnoreTagAttribute` | Specify the ignore attribute. All tags with this attribute will be excluded from every check. | `"data-proofer-ignore"` |
| `HTTPHeaders` | Dictionary of headers to include in external requests | `{"Range": "bytes=0-0", "Accept": "*/*"}` |
| `TestFilesConcurrently` | :warning: :construction: *EXPERIMENTAL* Turns on [concurrent](https://github.com/wjdp/htmltest/wiki/Concurrency) checking of files. | `false` |
Expand Down
1 change: 1 addition & 0 deletions htmltest/htmltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func Test(optsUser map[string]interface{}) (*HTMLTest, error) {
// > Programs that must disable HTTP/2 can do so by setting Transport.TLSNextProto ... to a non-nil, empty map.
// See issue #49
TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper),
TLSClientConfig: &tls.Config{InsecureSkipVerify : hT.opts.IgnoreSSLVerify},
}
hT.httpClient = &http.Client{
// Durations are in nanoseconds
Expand Down
2 changes: 2 additions & 0 deletions htmltest/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type Options struct {
IgnoreCanonicalBrokenLinks bool
IgnoreAltMissing bool
IgnoreDirectoryMissingTrailingSlash bool
IgnoreSSLVerify bool
IgnoreTagAttribute string

HTTPHeaders map[interface{}]interface{}
Expand Down Expand Up @@ -105,6 +106,7 @@ func DefaultOptions() map[string]interface{} {
"IgnoreCanonicalBrokenLinks": true,
"IgnoreAltMissing": false,
"IgnoreDirectoryMissingTrailingSlash": false,
"IgnoreSSLVerify": false,
"IgnoreTagAttribute": "data-proofer-ignore",

"HTTPHeaders": map[string]string{
Expand Down

0 comments on commit 30138c0

Please sign in to comment.