I found a new problem.
Some repositories have errors in the README.
For example, aws-sdk-ios.
This README says:
Add the following to your Cartfile:
github "aws / aws-sdk-ios"
The correct way of writing is this.
github "aws-amplify / aws-sdk-ios"
Carthage can redirect internally to get the correct value.
However, URLSession does not hold authentication information at redirect time.
We need to be careful.