func InitHTTPConnection(serverAddr, credentialsFile, caFile, fullServerName string) (*HTTPConnection, error) {
	credentials, err := setupCredentials(credentialsFile)
	if err != nil {
		return nil, err
	}
	config, err := setupCertConfig(caFile, fullServerName)
	if err != nil {
		return nil, err
	}
	protocol := "http"
	if config != nil {
		protocol = "https"
	}
	return &HTTPConnection{
		client: &http.Client{
			Timeout:   TimeoutDuration,
			Transport: &http.Transport{TLSClientConfig: config},
		},
		config:      config,
		credentials: credentials,
		marshaler:   &jsonpb.Marshaler{OrigName: true},
		baseURL:     protocol + "://" + serverAddr,
	}, nil
}
InitHTTPConnection creates and returns a new HTTPConnection object with a given server address and username/password.
package api
import (
	"bytes"
	"crypto/tls"
	"crypto/x509"
	"encoding/base64"
	"errors"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"strings"
	"time"
	"github.com/golang/protobuf/jsonpb"
	"github.com/google/hotel-booking-api-validator/utils"
	pb "github.com/google/hotel-booking-api-validator/v1"
)
const TimeoutDuration = 30 * time.Second
var reader = ioutil.ReadFile
type HTTPConnection struct {
	client      *http.Client
	config      *tls.Config
	credentials string
	marshaler   *jsonpb.Marshaler
	baseURL     string
}