Overview
TheAtlsHttp class provides a lower-level HTTP/1.1 client over attested TLS connections. It uses hyper’s battle-tested HTTP implementation to prevent CRLF injection attacks and correctly handle transfer encodings.
This class supports connection reuse via HTTP/1.1 keep-alive, allowing multiple requests on the same attested connection.
Class methods
connect
Establish an attested TLS connection and perform the HTTP/1.1 handshake.WebSocket proxy URL with optional target query parameter.Examples:
"ws://127.0.0.1:9000?target=vllm.example.com:443""ws://proxy.example.com:9000"
TLS server name for SNI and certificate validation.Example:
"vllm.example.com"Attestation verification policy object.See Policy configuration for details.
An
AtlsHttp instance ready for making HTTP requests.attestation
Get the attestation verification result from the connection handshake.fetch
Perform an HTTP request and return a response with streaming body.HTTP method (e.g., “GET”, “POST”, “PUT”)
Request path (e.g., “/v1/chat/completions”)
Host header value (typically the target hostname)
Array of header name-value pairs.Example:
[["Content-Type", "application/json"]]Optional request body as bytes
isReady
Check if the connection is ready for another request.true if the connection can accept a new request, false if closed or busy with an existing requestclose
Explicitly close the HTTP connection.Connection reuse
TheAtlsHttp class supports HTTP/1.1 keep-alive, allowing multiple requests on the same attested connection:
- Connection becomes ready for reuse after the response body is fully consumed
- Use
isReady()to check if the connection can accept a new request - If a request is made while the connection is busy, an error will be thrown
Examples
Basic request
Streaming response
Connection reuse
Security features
TheAtlsHttp class uses hyper’s HTTP/1.1 implementation which provides:
- CRLF injection prevention: Headers are validated to prevent injection attacks
- Transfer encoding support: Correctly handles chunked, content-length, and close-delimited encodings
- Battle-tested implementation: Uses the widely-deployed hyper HTTP library