diff --git a/README.md b/README.md index 203d7a8..c6df7be 100644 --- a/README.md +++ b/README.md @@ -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` | diff --git a/htmltest/htmltest.go b/htmltest/htmltest.go index f46a9fc..4d42b4d 100644 --- a/htmltest/htmltest.go +++ b/htmltest/htmltest.go @@ -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 diff --git a/htmltest/options.go b/htmltest/options.go index 57a25b4..b5619fb 100644 --- a/htmltest/options.go +++ b/htmltest/options.go @@ -44,6 +44,7 @@ type Options struct { IgnoreCanonicalBrokenLinks bool IgnoreAltMissing bool IgnoreDirectoryMissingTrailingSlash bool + IgnoreSSLVerify bool IgnoreTagAttribute string HTTPHeaders map[interface{}]interface{} @@ -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{