© 2026 Hedgehog Software, LLC
curl --tlsv1.2 \ --cacert Amazon-root-CA-1.pem \ --cert device.pem.crt \ --key private.pem.key \ --request POST \ --data "{ \"message\": \"Hello, world\" }" \ "https://IoT_data_endpoint:8443/topics/topic?qos=1"
pnpx wrangler mtls-certificate upload --cert device.pem.crt --key private.pem.key --name AWS_IOT
iotPublish.post("/", async (c) => { try { let topic = "test"; let message = { message: "hello" }; return await c.env.AWS_IOT.fetch( `https://xxxxxx.iot.eu-central-1.amazonaws.com:8443/topics/topic?qos=1`, { method: "POST", body: JSON.stringify(message), } ); } catch (e) { console.log(e); return Response.json({ error: JSON.stringify(e) }, { status: 500 }); } });
{ "message": "Missing authentication", "traceId": "8c6b18f4-b3d5-42c7-8edb-e2b0bbc09ad3" }