aws-amplify / amplify-swift

A declarative library for application development using cloud services.
Apache License 2.0
436 stars 192 forks source link

Amplify Auth signIn timeout due to an SSL error #1153

Closed hustakin closed 3 years ago

hustakin commented 3 years ago

Describe the bug Amplify.Auth.signIn will meet an SSL error and then timeout on my iOS simulator. It's a macbook m1, and the signin works fine on Android simulator of the macbook m1.

To Reproduce try { await Amplify.Auth.signIn( username: email, password: password, ); } on AuthException catch (e) { print('Error in signing in: ${e.message} - ${e.recoverySuggestion}'); }

Exception Logs `Unexpected error occurred with message: An unknown error occurred - This should not happen. There is a possibility that there is a bug if this error persists. Please take a look at https://github.com/aws-amplify/amplify-ios/issues to see if there are any existing issues that match your scenario, and file an issue with the details of the bug if there isn't. Issue encountered at: file: /Users/frankiefan/IdeaProjects/iot_pipeline_monitor/ios/Pods/Amplify/Amplify/Categories/Auth/Error/AuthError.swift function: recoverySuggestion line: 79

message: Unexpected error occurred with message: An unknown error occurred recoverySuggestion: This should not happen. There is a possibility that there is a bug if this error persists. Please take a look at https://github.**** underlyingException: An SSL error has occurred and a secure connection to the server cannot be made.`

amplify_bug

Platform Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply): [1] iOS

palpatim commented 3 years ago

@hustakin I wouldn't necessarily expect it to behave differently on an M1 Mac than on an x86, but can you try it on an x86 mac to see if you get the same behavior?

Other questions:

hustakin commented 3 years ago

@palpatim Sorry I don't have an x86 Mac now.

  1. The Flutter is the newest stable one: Flutter 2.0.4, and the libs related with Amplify are as follows: amplify_flutter: '<1.0.0' amplify_api: ^0.0.2-dev.1 amplify_auth_cognito: '<1.0.0' amplify_analytics_pinpoint: '<1.0.0' amplify_storage_s3: '<1.0.0'

  2. The simulator iOS version is: iPhone 12 Pro Max (iOS 14.5)

  3. No custom domain names and has the same issue when I try it at office network or home network.

  4. I didn't change any settings for security.

  5. amplifyconfiguration.dart: const amplifyconfig = ''' { "UserAgent": "aws-amplify-cli/2.0", "Version": "1.0", "analytics": { "plugins": { "awsPinpointAnalyticsPlugin": { "pinpointAnalytics": { "appId": "", "region": "us-west-2" }, "pinpointTargeting": { "region": "us-west-2" } } } }, "api": { "plugins": { "awsAPIPlugin": { "agtech": { "endpointType": "GraphQL", "endpoint": "https://.appsync-api.ap-southeast-2.amazonaws.com/graphql", "region": "ap-southeast-2", "authorizationType": "AMAZON_COGNITO_USER_POOLS" } } } }, "auth": { "plugins": { "awsCognitoAuthPlugin": { "UserAgent": "aws-amplify-cli/0.1.0", "Version": "0.1.0", "IdentityManager": { "Default": {} }, "AppSync": { "Default": { "ApiUrl": "https://*******.appsync-api.ap-southeast-2.amazonaws.com/graphql", "Region": "ap-southeast-2", "AuthMode": "AMAZON_COGNITO_USER_POOLS", "ClientDatabasePrefix": "agtech_AMAZON_COGNITO_USER_POOLS" } }, "CredentialsProvider": { "CognitoIdentity": { "Default": { "PoolId": "", "Region": "ap-southeast-2" } } }, "CognitoUserPool": { "Default": { "PoolId": "", "AppClientId": "", "AppClientSecret": "", "Region": "ap-southeast-2" } }, "Auth": { "Default": { "authenticationFlowType": "USER_SRP_AUTH" } }, "PinpointAnalytics": { "Default": { "AppId": "", "Region": "us-west-2" } }, "PinpointTargeting": { "Default": { "Region": "us-west-2" } }, "S3TransferUtility": { "Default": { "Bucket": "", "Region": "ap-southeast-2" } } } } }, "storage": { "plugins": { "awsS3StoragePlugin": { "bucket": "***", "region": "ap-southeast-2", "defaultAccessLevel": "guest" } } } }''';

hustakin commented 3 years ago

@palpatim Sorry I don't have an x86 Mac now.

  1. The Flutter is the newest stable one: Flutter 2.0.4, and the libs related with Amplify are as follows: amplify_flutter: '<1.0.0' amplify_api: ^0.0.2-dev.1 amplify_auth_cognito: '<1.0.0' amplify_analytics_pinpoint: '<1.0.0' amplify_storage_s3: '<1.0.0'
  2. The simulator iOS version is: iPhone 12 Pro Max (iOS 14.5)
  3. No custom domain names and has the same issue when I try it at office network or home network.
  4. I didn't change any settings for security.
  5. amplifyconfiguration.dart: const amplifyconfig = ''' { "UserAgent": "aws-amplify-cli/2.0", "Version": "1.0", "analytics": { "plugins": { "awsPinpointAnalyticsPlugin": { "pinpointAnalytics": { "appId": "**", "region": "us-west-2" }, "pinpointTargeting": { "region": "us-west-2" } } } }, "api": { "plugins": { "awsAPIPlugin": { "agtech": { "endpointType": "GraphQL", "endpoint": "https://**.appsync-api.ap-southeast-2.amazonaws.com/graphql", "region": "ap-southeast-2", "authorizationType": "AMAZON_COGNITO_USERPOOLS" } } } }, "auth": { "plugins": { "awsCognitoAuthPlugin": { "UserAgent": "aws-amplify-cli/0.1.0", "Version": "0.1.0", "IdentityManager": { "Default": {} }, "AppSync": { "Default": { "ApiUrl": "https://**.appsync-api.ap-southeast-2.amazonaws.com/graphql", "Region": "ap-southeast-2", "AuthMode": "AMAZON_COGNITO_USER_POOLS", "ClientDatabasePrefix": "agtech_AMAZON_COGNITO_USERPOOLS" } }, "CredentialsProvider": { "CognitoIdentity": { "Default": { "PoolId": "**", "Region": "ap-southeast-2" } } }, "CognitoUserPool": { "Default": { "PoolId": "**", "AppClientId": "**", "AppClientSecret": "_**", "Region": "ap-southeast-2" } }, "Auth": { "Default": { "authenticationFlowType": "USER_SRPAUTH" } }, "PinpointAnalytics": { "Default": { "AppId": "**", "Region": "us-west-2" } }, "PinpointTargeting": { "Default": { "Region": "us-west-2" } }, "S3TransferUtility": { "Default": { "Bucket": "**", "Region": "ap-southeast-2" } } } } }, "storage": { "plugins": { "awsS3StoragePlugin": { "bucket": "**", "region": "ap-southeast-2", "defaultAccessLevel": "guest" } } } }''';

@palpatim Please be noted that I hide the id related content in the amplifyconfiguration.dart

hustakin commented 3 years ago

@palpatim Finally got the reason... It's because of the Xcode on my mac m1.. I uninstall it and install the newest version, then everything is okay now.. Thank you.