amplify-swift: Amplify.auth: "Channel shutdown due to tls negotiation timeout" error, but only on mobile networks (works ok on wifi)
Describe the bug
I am writing a swiftui app using Amplify Auth/Cognito. I was able to get everything working well (Sign-up/Sign-in/Logout/etc…) until I tested it on a mobile network outside of my usual WIFI.
When on mobile networks I am getting a network error, however not only that my network is fine, also other network operations inside my app are working without any problem.
The error is:
“Channel shutdown due to tls negotiation timeout”
Steps To Reproduce
Steps to reproduce the behavior:
1. Use Amplify Authenticate in a Wifi environment - no problem, all works fine
2. Turn off wifi, open the app in the street while on mobile (5g) network - getting errors
3. One thing to note - I am in France, and I am using the us-east-1 server. However my fiber (and wifi) provider is the same as the one I am using for mobile.
Expected behavior
I expect everything to work as usual agnostic to what type of network I am using.
Maybe there’s a restriction using a US based server from a carrier in Europe?
Amplify Framework Version
2.4.0
Amplify Categories
Auth
Dependency manager
Swift PM
Swift version
5.7
CLI version
10.7.3
Xcode version
14.2 (14C18)
Relevant log output
<details>
<summary>Log Messages</summary>
**2023-03-20 12:33:41.316038+0100 my app [3920:1348453] [UserPoolSignInHelper]
Checking next step for:
signingInWithSRP(AWSCognitoAuthPlugin.SRPSignInState.error(AWSCognitoAuthPlugin.SignInError.service(error:
ClientRuntime.SdkError<AWSCognitoIdentityProvider.InitiateAuthOutputError>.client(ClientRuntime.ClientError.retryError(AwsCommonRuntimeKit.CRTError.crtError(AwsCommonRuntimeKit.AWSError(errorCode: 1067,
errorMessage: Optional("Channel shutdown due to tls negotiation timeout")))), nil))), ["password": "<REDACTED>", "username": "CC********************************21", "clientMetadata": [:],
"signInMethod": AWSCognitoAuthPlugin.SignInMethod.apiBased(AWSCognitoAuthPlugin.AuthFlowType.userSRP)])**
```
Is this a regression?
No
Regression additional context
No response
Device
iPhone 13 pro
iOS Version
16.2
Specific to simulators
No response
Additional context
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (7 by maintainers)
We are preparing for launch and the team is over stretched at the moment. I will be happy to try in a couple of weeks.
It seems that the requests are timing out due to a slow connection. To help us debug further, would you be able to provide the following?
Logs you see in the console when when this scenario happens. You can enable verbose logging to the console by doing this: