AWS CLI and AWS SDKs
Use the AWS CLI v2, boto3, the AWS SDK for JavaScript v3, the AWS SDK for Go v2 and the AWS SDK for Java 2.x with XNS storage.
Overview
The AWS CLI and the AWS SDKs talk to any S3-compatible endpoint once they are given three things: the Relayer’s endpoint URL, the region us-east-1 and path-style addressing. This guide gives the exact setting for each one, plus the one checksum setting that matters for the Java SDK over plain HTTP. For general S3 tooling notes, see S3 Integration and Tooling.
Tested with AWS CLI 2.38.1 and 2.34.46, boto3 1.43.114, AWS SDK for JavaScript v3 (@aws-sdk/client-s3 3.1152.0 on Node.js 20), AWS SDK for Go v2 (service/s3 1.114.3 on Go 1.27) and AWS SDK for Java 2.56.0 (Java 21) on 2026-10-18 against Relayer build 59a37e64.
Each run uploaded 205 files (including a 64 MiB file sent as a multipart upload, an empty file, and names with spaces and accented characters), listed and downloaded them, compared every file by SHA-256, and deleted them. Every client was run over HTTP on port 9000 and over HTTPS on port 9443.
Connect to XNS
Every S3 tool connects to your Relayer with the same settings. Enter them exactly as shown; the notes below the table cover the two that most tools get wrong by default.
| Setting | Value |
|---|---|
| Endpoint (HTTP) | http://<relayer-host>:9000, where <relayer-host> is the address of the machine running your Relayer. Always available. |
| Endpoint (HTTPS) | https://<relayer-host>:9443, available only after a certificate is installed on the Relayer. Port 9000 never serves HTTPS. |
| Region | us-east-1 |
| Addressing | Path-style. In tools that ask, turn on force path style or path-style access, and turn off virtual-hosted style. |
| Signature | Signature Version 4 (V4). Version 2 is refused. |
| Access key and secret key | For a tool, create a scoped key: IAM → Create IAM User in the Relayer UI. The secret is shown once, so copy it then. The install’s root pair is on Configure → Credentials; keep it for administration. |
| Bucket | Create it first: Files → Create Bucket in the Relayer UI, or let the tool create it. Names are 3-63 characters of lowercase letters, digits, hyphens and periods. |
HTTPS and certificates. The Relayer UI offers two certificates for port 9443: Let’s Encrypt, which needs a domain managed in Cloudflare and a Cloudflare API token, or self-signed. Most tools refuse a self-signed certificate unless certificate verification is turned off in the tool. On a private network, plain HTTP on port 9000 avoids the question.
Path-style. A tool left on virtual-hosted style (often labeled Amazon S3 or AWS) sends the bucket name in the hostname, and the Relayer cannot find the bucket. Choose the tool’s S3 compatible or generic S3 option and set path-style.
Not supported: server-side encryption with customer-provided keys (SSE-C) or KMS keys (SSE-KMS), bucket website hosting and bucket replication. Server-side encryption with AES256 is accepted. See Encryption at the Gateway, Identity and Access and Configure.
Prerequisites
- A bucket and a scoped key on your Relayer (see the table above). A key with the ReadWrite policy is enough for everything in this guide.
- The AWS CLI v2 (install guide), or the SDK for your language.
Step 1: Store the key in a profile
All the CLI and SDK examples below read the key from a named profile through AWS_PROFILE, so it never appears in code or on the command line. Every SDK’s default credential chain reads it.
aws configure --profile xns
# AWS Access Key ID: <access key>
# AWS Secret Access Key: <secret key>
# Default region name: us-east-1
# Default output format: json
export AWS_PROFILE=xnsOptionally, make path-style the profile’s default in ~/.aws/config. The CLI and boto3 read this setting:
[profile xns]
region = us-east-1
s3 =
addressing_style = pathStep 2: AWS CLI
Pass the endpoint with --endpoint-url. With a custom endpoint the CLI used path-style addressing in the tested run even without the addressing_style setting above.
aws --endpoint-url http://<relayer-host>:9000 s3 mb s3://<bucket>
aws --endpoint-url http://<relayer-host>:9000 s3 cp --recursive ./data s3://<bucket>/data/
aws --endpoint-url http://<relayer-host>:9000 s3 ls --recursive s3://<bucket>/data/
aws --endpoint-url http://<relayer-host>:9000 s3 cp --recursive s3://<bucket>/data/ ./restore/
aws --endpoint-url http://<relayer-host>:9000 s3 rm --recursive s3://<bucket>/data/For HTTPS, use --endpoint-url https://<relayer-host>:9443. To avoid repeating the flag, add endpoint_url = http://<relayer-host>:9000 to the profile in ~/.aws/config.
Step 3: Python (boto3)
import boto3
from botocore.config import Config
s3 = boto3.client(
"s3",
endpoint_url="http://<relayer-host>:9000",
region_name="us-east-1",
config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)
s3.upload_file("big.bin", "<bucket>", "data/big.bin")
s3.download_file("<bucket>", "data/big.bin", "big.copy")Step 4: JavaScript (AWS SDK v3)
import { S3Client, GetObjectCommand } from "@aws-sdk/client-s3";
import { Upload } from "@aws-sdk/lib-storage";
import fs from "node:fs";
const s3 = new S3Client({
endpoint: "http://<relayer-host>:9000",
region: "us-east-1",
forcePathStyle: true,
});
await new Upload({ client: s3, params: { Bucket: "<bucket>", Key: "data/big.bin",
Body: fs.createReadStream("big.bin") } }).done();Step 5: Go (AWS SDK v2)
cfg, err := config.LoadDefaultConfig(ctx,
config.WithRegion("us-east-1"))
if err != nil { return err }
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String("http://<relayer-host>:9000")
o.UsePathStyle = true
})
uploader := manager.NewUploader(client)Multipart downloads may log Skipped validation of multipart checksum. The warning is harmless: the downloaded files matched the originals.
Step 6: Java (AWS SDK 2.x)
S3Client s3 = S3Client.builder()
.endpointOverride(URI.create("http://<relayer-host>:9000"))
.region(Region.US_EAST_1)
.forcePathStyle(true)
.serviceConfiguration(S3Configuration.builder()
.chunkedEncodingEnabled(false) // needed over plain HTTP, see below
.build())
.build();Over HTTPS on port 9443 the Java SDK worked with its defaults; chunkedEncodingEnabled(false) also works there, so you can leave it on for both.
Checksums and streaming uploads
Current SDKs add a checksum to every upload by default. How they send it depends on the SDK and on whether the connection is HTTP or HTTPS:
- Checksum in a request header: the Relayer checks it against the bytes it received and refuses a mismatch with
BadDigest. - Checksum in an unsigned trailer (
STREAMING-UNSIGNED-PAYLOAD-TRAILER): accepted. The Relayer discards the trailer, so this checksum is not verified on the Relayer. The AWS CLI 2.38, boto3, JavaScript and Go SDKs used this form or the header form, and all worked over HTTP and HTTPS with their defaults. - Checksum in a signed trailer (
STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER): not supported. The Java SDK 2.x uses it for uploads over plain HTTP, and the Relayer answers500 InternalError. SettingAWS_REQUEST_CHECKSUM_CALCULATION=when_requiredis not enough on its own: the SDK then switches to signed chunked uploads, and empty (0-byte) uploads still fail with 500. UsechunkedEncodingEnabled(false), as above, or use HTTPS.
Known limits
- Path-style is required. Set it in every SDK (
addressing_style: path,forcePathStyle,UsePathStyle). Virtual-hosted style puts the bucket in the hostname, which the Relayer does not resolve. - Java over HTTP needs
chunkedEncodingEnabled(false), or use port 9443. With the defaults, multipart uploads fail with500 InternalError. - Trailer checksums are not verified. When an SDK sends its checksum in an unsigned trailer, the Relayer accepts the upload without checking that checksum.
- Self-signed certificates on port 9443 are refused by the CLI and the SDKs unless you point them at the certificate (for the CLI,
--ca-bundleorAWS_CA_BUNDLE). This was not tested here; the test used a trusted certificate. - Not supported by the Relayer: SSE-C and SSE-KMS server-side encryption, bucket website hosting and bucket replication.
