Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signing URLs with explicit ports #7

Open
khanlou opened this issue Jun 4, 2021 · 5 comments
Open

Signing URLs with explicit ports #7

khanlou opened this issue Jun 4, 2021 · 5 comments

Comments

@khanlou
Copy link

khanlou commented Jun 4, 2021

Great library, definitely gets the job done for us! We've vendored it and noticed an issue with how this code interacts with URLSession.

When signing a url (e.g., for S3) with a port in it, such as https://s3.amazonaws.com:443/bucket... the signature will be computed with the port. However, when requesting the content of that URL with URLSession (or Data(contentsOf:)), the port is stripped out, and the signature is no longer correct, and AWS returns a 403.

We're currently playing with a few solutions, including stripping the port before signing.

@adam-fowler
Copy link
Owner

Oh I had to do some similar work in Soto the Swift AWS SDK. Don't think I ported the changes to aws-signer-v4. You might be better using the signer from SotoCore that is guaranteed to be kept up to date.

@khanlou
Copy link
Author

khanlou commented Jun 4, 2021

@adam-fowler
Copy link
Owner

Yep that'd be it

@khanlou
Copy link
Author

khanlou commented Jun 4, 2021

Okay, cool. Feel free to close this issue or address it, we'll fix on our side!

@adam-fowler
Copy link
Owner

I'll leave it open, to remind me to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants