func BuildHTTPClient(options *auth.Options) (*http.Client, error) {
	client := getClient()
	if MtlsEnabled(options) {
		cert, err := tls.LoadX509KeyPair(options.Certificate, options.Key)
		if err != nil {
			return nil, err
		}
		client.Transport.(*http.Transport).TLSClientConfig = &tls.Config{
			Certificates: []tls.Certificate{cert},
		}
		return client, nil
	} else {
		if options.SSLDisabled {
			client.Transport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
		}
	}
	return client, nil
}
BuildHTTPClient builds custom http client with configured ssl validation / mtls
package util
import (
	"crypto/tls"
	"errors"
	"fmt"
	"github.com/Peripli/service-manager-cli/pkg/auth"
	"net"
	"net/http"
	"net/url"
	"time"
)
func ValidateURL(URL string) error {
	if URL == "" {
		return errors.New("url not provided")
	}
	parsedURL, err := url.Parse(URL)
	if err != nil {
		return fmt.Errorf("url cannot be parsed: %s", err)
	}
	if !parsedURL.IsAbs() || (parsedURL.Scheme != "http" && parsedURL.Scheme != "https") {
		return fmt.Errorf("url is not an HTTP URL: %s", URL)
	}
	return nil
}