@@ -2,6 +2,7 @@ package main
22
33import (
44 "crypto"
5+ "crypto/tls"
56 "encoding/base64"
67 "fmt"
78 "net/http"
@@ -47,14 +48,15 @@ type Options struct {
4748 CookieSecure bool `flag:"cookie-secure" cfg:"cookie_secure"`
4849 CookieHttpOnly bool `flag:"cookie-httponly" cfg:"cookie_httponly"`
4950
50− Upstreams []string `flag:"upstream" cfg:"upstreams"`
51− SkipAuthRegex []string `flag:"skip-auth-regex" cfg:"skip_auth_regex"`
52− PassBasicAuth bool `flag:"pass-basic-auth" cfg:"pass_basic_auth"`
53− BasicAuthPassword string `flag:"basic-auth-password" cfg:"basic_auth_password"`
54− PassAccessToken bool `flag:"pass-access-token" cfg:"pass_access_token"`
55− PassHostHeader bool `flag:"pass-host-header" cfg:"pass_host_header"`
56− SkipProviderButton bool `flag:"skip-provider-button" cfg:"skip_provider_button"`
57− PassUserHeaders bool `flag:"pass-user-headers" cfg:"pass_user_headers"`
51+ Upstreams []string `flag:"upstream" cfg:"upstreams"`
52+ SkipAuthRegex []string `flag:"skip-auth-regex" cfg:"skip_auth_regex"`
53+ PassBasicAuth bool `flag:"pass-basic-auth" cfg:"pass_basic_auth"`
54+ BasicAuthPassword string `flag:"basic-auth-password" cfg:"basic_auth_password"`
55+ PassAccessToken bool `flag:"pass-access-token" cfg:"pass_access_token"`
56+ PassHostHeader bool `flag:"pass-host-header" cfg:"pass_host_header"`
57+ SkipProviderButton bool `flag:"skip-provider-button" cfg:"skip_provider_button"`
58+ PassUserHeaders bool `flag:"pass-user-headers" cfg:"pass_user_headers"`
59+ SSLInsecureSkipVerify bool `flag:"ssl-insecure-skip-verify" cfg:"ssl_insecure_skip_verify"`
5860
5961 // These options allow for other providers besides Google, with
6062 // potential overrides.
@@ -99,7 +101,6 @@ func NewOptions() *Options {
99101 PassUserHeaders: true,
100102 PassAccessToken: false,
101103 PassHostHeader: true,
102− SkipProviderButton: false,
103104 ApprovalPrompt: "force",
104105 RequestLogging: true,
105106 }
@@ -205,6 +206,13 @@ func (o *Options) Validate() error {
205206 msgs = parseSignatureKey(o, msgs)
206207 msgs = validateCookieName(o, msgs)
207208
209+ if o.SSLInsecureSkipVerify {
210+ insecureTransport := &http.Transport{
211+ TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
212+ }
213+ http.DefaultClient = &http.Client{Transport: insecureTransport}
214+ }
215+
208216 if len(msgs) != 0 {
209217 return fmt.Errorf("Invalid configuration:\n %s",
210218 strings.Join(msgs, "\n "))