TLS Endpoints
Overview
TLS endpoints enable you to deliver any network service that runs over a TLS-based protocol. TLS endpoints make no assumptions about the wrapped protocol being transported.
TLS endpoints inspect the Server Name Indication (SNI) data on incoming TLS connections to route connections to the appropriate endpoint.
Because the TLS protocol describes no application-level semantics, ngrok can only offer a limited set of traffic policy actions to handle TLS traffic.
If you are delivering an HTTPS application, prefer to create an HTTP Endpoint.
Quickstart
- Agent CLI
- Agent Config
- SSH
- Go
- Javascript
- Python
- Rust
- Kubernetes Controller
Loading…
SSH does not support termination at the edge
Loading…
Go Package Docs:
Loading…
Javascript SDK Docs:
-
https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#domain
-
https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#crt
-
https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#key
-
https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#domain
-
https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#termination
Loading…
Python SDK Docs:
The Rust SDK does not support TLS termination at the ngrok edge
TLS endpoints are not supported by the ngrok Kubernetes Operator
URLs
URLs are validated differently depending on their binding. Consult the following documentation for details on valid URLs for TLS endpoints:
There is no standard scheme for TLS URLs so ngrok renders them as tls://
.
Bindings
TLS endpoints support public
and internal
bindings. kubernetes
binding is
not supported.
Traffic Policy
Attach Traffic Policy to endpoints to route, authenticate and transform the traffic through your TLS endpoints.
Authentication
When you create public TLS endpoints, you often want to secure them with authentication. You can secure your TLS endpoints with the following Traffic Policy actions. There is a limited set of actions available to authenticate TLS traffic because the TLS protocol is low-level.
TLS
Termination
TLS Endpoints provide you with the flexibility to define where TLS termination occurs. You may configure your endpoint to terminate TLS at the ngrok cloud service or you can achieve end-to-end encryption by terminating at the agent or your upstream service. When you use end-to-end encryption, the ngrok cloud service can not see payload that transit through your endpoints.
Consult the documentation on TLS Termination Locations for additional details.
Cloud Service
- Agent CLI
- Agent Config
- SSH
- Go
- Javascript
- Python
- Rust
- Kubernetes Controller
Loading…
SSH does not support termination at the edge
Loading…
Go Package Docs:
Loading…
Javascript SDK Docs:
-
https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#domain
-
https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#crt
-
https://ngrok.github.io/ngrok-javascript/interfaces/Config.html#key
-
https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#domain
-
https://ngrok.github.io/ngrok-javascript/classes/TlsListenerBuilder.html#termination
Loading…
Python SDK Docs:
The Rust SDK does not support TLS termination at the ngrok edge
TLS endpoints are not supported by the ngrok Kubernetes Operator
Terminate at Agent
See TLS Termination at the Agent for End-to-End Encryption for additional details.
- Agent CLI
- Agent Config
- SSH
- Go
- Javascript
- Python
- Rust
- Kubernetes Controller
Loading…
Loading…
SSH does not support termination at the agent
The Go SDK does not support TLS termination at the SDK
The Javascript SDK does not support TLS termination at the SDK.
The Python SDK does not support TLS termination at the SDK.
The Rust SDK does not support TLS termination at the SDK.
TLS endpoints are not supported by the ngrok Kubernetes Operator
Terminate at Upstream
- Agent CLI
- Agent Config
- SSH
- Go
- Javascript
- Python
- Rust
- Kubernetes Controller
Loading…
Loading…
Loading…
Loading…
Javascript SDK Docs:
Loading…
Python SDK Docs:
Loading…
Rust Crate Docs:
TLS endpoints are not supported by the ngrok Kubernetes Operator
Certificates
It is very common to encounter certificate errors when working with TLS endpoints. When terminating TLS at ngrok's cloud service, ngrok will automatically select, provision and manage certs for you. When performing end-to-end encryption by terminating at the agent or upstream service, you become responsible for provisioning, managing and distributing certificates.
Consult the documentation on TLS Certificates for details about certificate selection, provisioning and management.
Agent Forwarding
Re-encrypt to Upstream
If you terminate TLS at the ngrok cloud service or ngrok agent, you may want to
re-encrypt the connection from the agent to your upstream service. The ngrok
agent supports this behavior by using the non-standard tls://
scheme syntax.
- Agent CLI
- Agent Config
- SSH
- Go
- Javascript
- Python
- Rust
- Kubernetes Controller
Loading…
Loading…
Re-encrypting the connection to your upstream service with TLS is not supported via SSH.
Re-encrypting the connection to your upstream service with TLS is not supported in the Go SDK.
Loading…
An empty certificate and key will default to the ngrok edge's automatically provisioned keypair. The upstream certificate of localhost:443
will be validated by a filepath specified in the SSL_CERT_FILE
environment variable (e.g. SSL_CERT_FILE=/path/to/ca.crt
), or falling back to the host OS installed trusted certificate authorities.
Javascript SDK Docs:
Loading…
An empty certificate and key will default to the ngrok edge's automatically provisioned keypair. The upstream certificate of localhost:443
will be validated by a filepath specified in the SSL_CERT_FILE
environment variable (e.g. SSL_CERT_FILE=/path/to/ca.crt
), or falling back to the host OS installed trusted certificate authorities.
Python SDK Docs:
Re-encrypting the connection to your upstream service with TLS is not yet supported in the Rust SDK.
TLS endpoints are not supported by the ngrok Kubernetes Operator
PROXY Protocol
Add a PROXY protocol header on connection to your upstream service. This sends connection information like the original client IP address to your upstream service.
- Agent CLI
- Agent Config
- SSH
- Go
- Javascript
- Python
- Rust
- Kubernetes Controller
Loading…
Loading…
PROXY proto is not support via SSH.
Loading…
Javascript SDK Docs:
Loading…
Python SDK Docs:
Loading…
Rust Crate Docs:
TLS Endpoints are not supported via the ngrok Kubernetes Operator
Compatible Clients
SNI
TLS endpoints only work with modern TLS clients that populate the SNI extension. See the documentation on TLS Termination for additional details on compatible clients.
STARTTLS
Protocols that begin in plain text and upgrade to TLS via a mechanism like STARTTLS in SMTP, IMAP, etc are not supported. If you need to support connections which upgrade to TLS, use a TCP Endpoint.
Observability
Traffic Inspector
Traffic Inspector does not support TLS endpoints.
Log Export Events
You can export logs of traffic to TLS endpoints with ngrok's events system. The following events are published for log exporting:
Event | When |
---|---|
tcp_connection_closed.v0 | Published when a TCP connection to a TCP endpoint completes. |
Limits & Timeouts
Contact us if you need to configure limits and timeouts on connections to TLS endpoints.
Connections
Limit | Name | Notes |
---|---|---|
3 seconds | ClientHello Timeout | Time between connection establishment and ClientHello received |
5 minutes | Client Idle Timeout | Time since data was last transmitted by the upstream service |
5 minutes | Server Idle Timeout | Time since data was last transmitted by the upstream service |
No limit | Data transmitted | Data transmitted by the client or upstream service |
TLS
Limit | Name | Notes |
---|---|---|
60 seconds | TLS Handshake Duration | Time between ClientHello received and handshake completion |
64 KB | Handshake Message Size | Max size of non-certificate handshake messages |
256 KB | Certificate Message Size | Max size of certificate handshake messages |
16 KB | Record Payload Size |
Errors
If a TLS handshake fails, an appropriate TLS abort code will be sent to the client.
In all other cases, if an error is encountered while handling TLS connections to your endpoints (e.g. no available backends or internal server error), the connection will be closed. The TLS protocol and its implementations are not sufficiently flexible enough to deliver additional rich error information when failures are encountered.
Use the observability features to understand connection handling errors.
API
TLS Endpoints can be created programatically. Consult the documentation on Endpoint APIs.
Pricing
TLS endpoints are available on Pay-as-you-go, Pro, and Enterprise plans. Consult the Endpoints Pricing documentation for billing details.
See Domains pricing for details on pricing for custom domains, wildcard domains and more.
Zero-knowledge TLS is available on the Enterprise plan.