Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var OutgoingAccessAllowed = true
OutgoingAccessAllowed determines whether connections other than localhost can be dialled. Used for testing via the juju conn suite and the base suite.
Functions ¶
func BasicAuthHeader ¶
BasicAuthHeader creates a header that contains just the "Authorization" entry. The implementation was originally taked from net/http but this is needed externally from the http request object in order to use this with our websockets. See 2 (end of page 4) http://www.ietf.org/rfc/rfc2617.txt "To receive authorization, the client sends the userid and password, separated by a single colon (":") character, within a base64 encoded string in the credentials."
func NewHttpTLSTransport ¶
NewHttpTLSTransport returns a new http.Transport constructed with the TLS config and the necessary parameters for Juju.
func ParseBasicAuthHeader ¶
ParseBasicAuth attempts to find an Authorization header in the supplied http.Header and if found parses it as a Basic header. See 2 (end of page 4) http://www.ietf.org/rfc/rfc2617.txt "To receive authorization, the client sends the userid and password, separated by a single colon (":") character, within a base64 encoded string in the credentials."
func SecureTLSConfig ¶
SecureTLSConfig returns a tls.Config that conforms to Juju's security standards, so as to avoid known security vulnerabilities in certain configurations.
Currently it excludes RC4 implementations from the available ciphersuites, requires ciphersuites that provide forward secrecy, and sets the minimum TLS version to 1.2.
Types ¶
type Client ¶
type Client struct { HTTPClient // contains filtered or unexported fields }
Client represents an http client.
type Config ¶
type Config struct { // CACertificates contains an optional list of Certificate // Authority certificates to be used to validate certificates // of cloud infrastructure components. // The contents are Base64 encoded x.509 certs. CACertificates []string // Jar specifies the cookie jar. // // The Jar is used to insert relevant cookies into every // outbound Request and is updated with the cookie values // of every inbound Response. The Jar is consulted for every // redirect that the Client follows. // // If Jar is nil, cookies are only sent if they are explicitly // set on the Request. Jar http.CookieJar // SkipHostnameVerification indicates whether to use self-signed credentials // and not try to verify the hostname on the TLS/SSL certificates. SkipHostnameVerification bool // Logger is used to provide logging with the provided Client. // When logging level is set to Trace, the httptrace package is // used to log details about any Get done. If empty, a local // logger is created. Logger Logger }
Config holds configuration for creating a new http client.
type HTTPClient ¶
HTTPClient represents an http.Client.