TLS issue - WORKER to AWS IoT Core
EDIT: THIS WORKS NOW! Just follow the steps bellow...
EDIT: Make sure the compatibility_date = "2024-09-30" in your wrangler.toml is at least september 2024.
I am trying to communicate to the AWS IoT core HTTPS endpoint through a cloudflare worker (using hono).
I created a certificate and I tested successfully sending a message with curl and the downloaded certificates - https://docs.aws.amazon.com/iot/latest/developerguide/http.html
Then I configured the binding with wrangler
And then I configured an endpoint in hono
The result is always
Edit: you should get
Enjoy
12 Replies
You're testing on a deployed worker, I assume?
and you configured the binding in your wrangler.toml? https://developers.cloudflare.com/workers/runtime-apis/bindings/mtls/
Cloudflare Docs
mTLS · Cloudflare Workers docs
Configure your Worker to present a client certificate to services that enforce an mTLS connection.
Yes and yes. I heard that might be an issue with the port. Did you manage to test it @Chaika ?
Reference experience form another use https://community.cloudflare.com/t/tls-issue-workers-to-aws-iot-core/631845/5
@Chaika any news on this?
@Community Champion Anyone can help with this?
?pings
Please do not ping community members for non-moderation reasons. Doing so will not solve your issue faster and will make people less likely to want to help you.
You might have luck if you update your compatibility date:
https://developers.cloudflare.com/workers/configuration/compatibility-dates/#allow-specifying-a-custom-port-when-making-a-subrequest-with-the-fetch-api
Meaning this should now be supported I think
Cloudflare Docs
Compatibility dates | Cloudflare Workers docs
Opt into a specific version of the Workers runtime for your Workers project.
Thank you and sorry for the ping... I should have read the rules before doing that.
Did that solve the issue you were having?
Could it be related to this https://community.cloudflare.com/t/tls-issue-workers-to-aws-iot-core/631845/5 ?
Sadly still the same result: {
"message": "Missing authentication",
"traceId": "8c6b18f4-b3d5-42c7-8edb-e2b0bbc09ad3"
} ... Could it be related to this https://community.cloudflare.com/t/tls-issue-workers-to-aws-iot-core/631845/5 ?
originally, that was indeed the case, fetch ignored custom ports and always went to :443 for https
there is a compat flag that is enabled by default now, which should let you fetch custom ports
Requires permission to access the Publish action. HTTPS Publish only X.509 client certificate 8443 N/A~~Scratch that, I should have read your original post better - but still yeah, the fetch is working but something's wrong with auth for sure. Maybe a bad certificate?
Actually the solution did work! It was a fault in my code that i didint change back after testing...
I changed the description so that if someone stumbles here understands that it works now
Neat! Glad you got it working