Documentation ¶
Overview ¶
Package tlsproxy provides a reverse proxy that wraps an HTTP service with HTTPS. It uses Square's Ghostunnel (https://github.com/ghostunnel/ghostunnel) for the proxy.
Certificate generation is currently hardcoded; custom certificates cannot be supplied. Certificates are valid for a short time making this package mostly suitable for testing. A certificate authority is generated and provided.
Index ¶
- Constants
- type TLSProxy
- func (tp *TLSProxy) CertificateAuthorityPEM() ([]byte, error)
- func (tp *TLSProxy) Delete(ctx context.Context, cl client.Client, opts ...lifecycle.DeleteOption) (bool, error)
- func (tp *TLSProxy) Load(ctx context.Context, cl client.Client) (bool, error)
- func (tp *TLSProxy) Owned(ctx context.Context, owner lifecycle.TypedObject) error
- func (tp *TLSProxy) Persist(ctx context.Context, cl client.Client) error
- func (tp *TLSProxy) URL() string
Constants ¶
const Image = "squareup/ghostunnel:v1.5.2"
Image is the Docker image for Ghostunnel to use.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TLSProxy ¶
type TLSProxy struct { Key client.ObjectKey OwnerConfigMap *corev1obj.ConfigMap Service *corev1obj.Service Secret *corev1obj.TLSSecret Deployment *appsv1obj.Deployment }
TLSProxy is the service and deployment information for an instance of a reverse proxy.
func Apply ¶
func Apply(ctx context.Context, cl client.Client, key client.ObjectKey, addr string) (*TLSProxy, error)
Apply loads, configures, and persists any changes to a TLS proxy using the given client.
func (*TLSProxy) CertificateAuthorityPEM ¶
CertificateAuthorityPEM returns the PEM-encoded CA to use for validating connections to the service.