http

package
v3.6.7+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2021 License: Apache-2.0 Imports: 9 Imported by: 8

Documentation

Overview

Package http provides an easy way to construct an http client with custom certificates and customizable timeout. If you need to customize other attributes you can use the golang http package. https://golang.org/pkg/net/http/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(CABundleFile, CABundleDir string, httpTimeout time.Duration) (*http.Client, error)

New creates a new http.Client with a custom certificate, which can be loaded from the passed CA Bundle file and/or directory. If both CABundleFile and CABundleDir are empty arguments, it creates an unsecure HTTP client.

func NewAcceptInvalidHostname

func NewAcceptInvalidHostname(CABundleFile, CABundleDir string, httpTimeout time.Duration, hostname string) (*http.Client, error)

NewAcceptInvalidHostname new http.Client with ability to accept HTTPS certificates that don't match the hostname of the server they are connecting to.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL