mutualTLS-proxy handles TLS termination for ingress initiated two-way TLS (mutual authentication) and acts as a gateway for inbound traffic.
It does not check CRL for revoked certificates.
mutualTLS-proxy is ideally deployed as an OS service providing following features:
- Automatic start-up after server reboots.
- Automatic restart upon application crashes.
We will cover an example setup which works for Ubuntu Server 22.04
.
-
Copy application to designated server's
/opt/mutualTLS/
folder. Rename the binary tomutualTLS-proxy
. -
Create service file at
/etc/systemd/system/mutualTLS-proxy.service
with following service config:
[Service]
Environment="SERVE_ADDR=:443"
Environment="PATH_SERVER_KEY_FILE=/etc/ssl/private/your-server-private-key.key"
Environment="PATH_SERVER_CERT_FILE=/etc/ssl/certs/your-server-certificate.crt"
Environment="DIR_CLIENT_CA_FILES=/opt/mutualTLS/clientCAs"
Environment="ROUTE_BASE_ADDR=https://address-to-route-traffic-to"
Environment="GATEWAY_TIMEOUT_SECS=180"
Environment="ALLOWED_HTTP_VERBS=GET;POST;PUT;DELETE"
Environment="VERBOSE_LOGGING=0"
Restart=on-failure
RestartSec=5s
ExecStart=/opt/mutualTLS/mutualTLS-proxy
[Install]
WantedBy=multi-user.target
(See Environment Variables section at the end of the list for detailed descriptions of environment variables.)
-
Put trusted client certificates into
/opt/mutualTLS/clientCAs
(according to example config above.). -
Execute
sudo systemctl enable mutualTLS-proxy.service
to enable service to auto-start after server reboots. -
Execute
sudo systemctl restart mutualTLS-proxy.service
to start the service.
SERVE_ADDR: Application host address. Use :443
to accept traffic from default HTTPS port.
PATH_SERVER_KEY_FILE: Path of the server's private key.
PATH_SERVER_CERT_FILE: Path of the server's certificate file.
DIR_CLIENT_CA_FILES: Root path of the trusted client CAs.
ROUTE_BASE_ADDR: Base address to route incoming traffic after TLS termination.
GATEWAY_TIMEOUT_SECS: Timeout in seconds for gateway's http client.
ALLOWED_HTTP_VERBS: Semicolon separated list of allowed inbound http verbs.
sudo journalctl -u mutualTLS-proxy -f
Additionally, file system logs are available at: /var/log/mutualTLS-proxy
Note: Trusted client CAs are expected to be in directory defined by DIR_CLIENT_CA_FILES
environment variable.
-
Assuming new client's name is
clientX
and you are adding the certificate in the year2024
, you should create a new folder named2024_clientX
. -
Put client CAs under
/opt/mutualTLS/clientCAs/2024_clientX
. -
Restart mutualTLS-proxy service by executing:
sudo systemctl restart mutualTLS-proxy.service