https

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package https contains utilities for starting https servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertificateExists

func CertificateExists(ctx context.Context, cr *chrome.Chrome, br *browser.Browser, tconn *chrome.TestConn, certName, authOrgName string) (bool, error)

CertificateExists returns whether the certificate already exists.

func ConfigureChromeToAcceptCertificate

func ConfigureChromeToAcceptCertificate(ctx context.Context, config ServerConfiguration, cr *chrome.Chrome, br *browser.Browser, tconn *chrome.TestConn) error

ConfigureChromeToAcceptCertificate adds the specified CA certificate to the authorities configuration of chrome. The server certificate will then be accepted by chrome without complaining about security.

Types

type Server

type Server struct {
	ServerConfiguration ServerConfiguration

	Address string
	Error   error
	// contains filtered or unexported fields
}

The Server structure contains all meta data and control objects for a https server.

func StartServer

func StartServer(config ServerConfiguration) Server

StartServer starts up an https server without blocking. Returns a Server instance containing - the server configuration, - the base address, - an error object in case the server could not be started.

func (Server) Close

func (server Server) Close() error

Close shuts down a server that was started with the StartServer function.

type ServerConfiguration

type ServerConfiguration struct {
	Headers               map[string]string
	ServerKeyPath         string
	ServerCertificatePath string
	HostedFilesBasePath   string
	CaCertificatePath     string
}

The ServerConfiguration structure that stores all information to start the https server.

Jump to

Keyboard shortcuts

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