mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Remove https check for client connection (#489)
Removes the https requirement for localhost only.
This commit is contained in:
parent
4691ac9629
commit
5c69094571
1 changed files with 4 additions and 4 deletions
|
|
@ -36,15 +36,15 @@ type ClientOption func(*Client) error
|
|||
func NewClient(addr string, insecureSkipVerify bool, rootCA, urlPrefix string, options ...ClientOption) (*Client, error) {
|
||||
// TODO #265 refactor all optional parameters to functional options
|
||||
// API breaking change, needs a major version release
|
||||
if !strings.HasPrefix(addr, "https://") {
|
||||
return nil, errors.New("Address must start with https://")
|
||||
}
|
||||
|
||||
baseURL, err := url.Parse(addr)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "parsing URL")
|
||||
}
|
||||
|
||||
if baseURL.Scheme != "https" && !strings.Contains(baseURL.Host, "localhost") {
|
||||
return nil, errors.New("address must start with https:// for remote connections")
|
||||
}
|
||||
|
||||
rootCAPool := x509.NewCertPool()
|
||||
if rootCA != "" {
|
||||
// read in the root cert file specified in the context
|
||||
|
|
|
|||
Loading…
Reference in a new issue