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

Unable to get local issuer certificate when configure Amplify on Windows Devices #4714

Open
3 of 14 tasks
CarlosEspinozaMaruri opened this issue Apr 15, 2024 · 8 comments
Open
3 of 14 tasks
Labels
auth Issues related to the Auth Category feature-request A request for a new feature or an enhancement to an existing API or category.

Comments

@CarlosEspinozaMaruri
Copy link

CarlosEspinozaMaruri commented Apr 15, 2024

Description

I encountered an issue while configuring Authentication and Analytics in our cross-platform mobile app (Android, iOS, Windows). When attempting Amplify.configure(amplifyConfig), an error is triggered, but this issue is isolated to certain Windows devices. The configuration process works without issues on Android and iOS devices.

Error Details:
The error message received is as follows:

flutter: WARN  | Analytics  | Could not update endpoint: NetworkException {
  "message": "The request failed due to a network error.",
  "recoverySuggestion": "Ensure that you have an active network connection",
  "underlyingException": "POST https://cognito-identity.us-west-2.amazonaws.com/? failed: HandshakeException: Handshake error in client (OS Error: \n\tCERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(../../third_party/boringssl/src/ssl/handshake.cc:393))"
}

In certain cases, reinstalling the app temporarily resolves the issue on affected Windows devices. However, the problem resurfaces consistently after 1-2 days post reinstallation.

Auth error is a similar one with the same underlyingException.

Notes
Connectivity: Stable internet connection via LAN wire.
Windows version: Windows 10 Home

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

Try to configure amplify plugins using Amplify.configure(amplifyConfig)

Screenshots

image image

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.10.0

Amplify Flutter Version

1.7.0 and lower

Deployment Method

Amplify CLI

Schema

No response

@NikaHsn
Copy link
Contributor

NikaHsn commented Apr 15, 2024

@CarlosEspinozaMaruri thanks for taking the time to raise this issue. Can you please share the code for instantiating the plugins you use before calling amplify.configure()

@NikaHsn NikaHsn added pending-response Issue is pending response from the issue requestor pending-triage This issue is in the backlog of issues to triage labels Apr 15, 2024
@CarlosEspinozaMaruri
Copy link
Author

@NikaHsn Sure,

 try {
    await amplify_flutter.Amplify.addPlugins(
      [
        pinpoint.AmplifyAnalyticsPinpoint(),
        auth_cognito.AmplifyAuthCognito(),
      ],
    );
    await amplify_flutter.Amplify.configure(amplifyconfig);
  } on amplify_flutter.AmplifyAlreadyConfiguredException catch (_) {
    print(
        "Tried to reconfigure Amplify; this can occur when your app restarts on Android.");
 }

@NikaHsn
Copy link
Contributor

NikaHsn commented Apr 16, 2024

The issue with HTTPS calls failing due to Dart's inability to verify the SSL certificate is a known problem in Dart with an open issue dart-lang/http/issues/627
can you please confirm if the devices are set to the correct date/time and they are not using a VPN?

@NikaHsn NikaHsn added duplicate This issue or pull request already exists and removed pending-triage This issue is in the backlog of issues to triage labels Apr 16, 2024
@CarlosEspinozaMaruri
Copy link
Author

Yes, all devices are in the correct timezone and not using VPN

@Jordan-Nelson Jordan-Nelson added pending-triage This issue is in the backlog of issues to triage and removed pending-response Issue is pending response from the issue requestor duplicate This issue or pull request already exists labels May 3, 2024
@Jordan-Nelson
Copy link
Contributor

@CarlosEspinozaMaruri - Apologies for the delay. Can you tell us more about the windows devices you are experiencing this on? How many devices are you seeing this on? Are they running specific versions of Windows? Are there windows devices that you are not seeing this issue on?

@Jordan-Nelson Jordan-Nelson added pending-response Issue is pending response from the issue requestor auth Issues related to the Auth Category labels May 3, 2024
@Jordan-Nelson
Copy link
Contributor

Jordan-Nelson commented May 3, 2024

I think the issue is that Dart does not support root certificates that are installed lazily. This impacts Windows devices. There is an issue open for this with dart: dart-lang/sdk#52266

It is possible that we could work around this by including the root certificates required by AWS services in Amplify Flutter. See realm/realm-dart@8792fff for an example of how this could be done.

Another option would be to allow developers to provide their own http client so they could work around this.

I am going to mark this as a feature request for the time being. If you can provide us with more info about the devices you are seeing this on, or the frequency at which it occurs that would be helpful in determining the priority of supporting this.

It is not clear to me why this would resurface on the same device. If you can provide more details around that it would be helpful as well.

@Jordan-Nelson Jordan-Nelson added feature-request A request for a new feature or an enhancement to an existing API or category. and removed pending-response Issue is pending response from the issue requestor pending-triage This issue is in the backlog of issues to triage labels May 3, 2024
@CarlosEspinozaMaruri
Copy link
Author

Hello @Jordan-Nelson, The error occurs across some client's devices. The available information suggests they are running on Windows 10 (not sure if running with windows license). However, it's worth noting that there are instances where it works seamlessly on both Windows 10 and 11 devices.

@Jordan-Nelson
Copy link
Contributor

Hi @CarlosEspinozaMaruri thanks for the info. If you are able to find out any more info about the devices that this occurs on please let us know. For now we are going to track this as a feature request because it seems like the issue is how Windows/Dart handles root certs. There might be a way to work around it, but ideally this is resolved in the Dart SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues related to the Auth Category feature-request A request for a new feature or an enhancement to an existing API or category.
Projects
None yet
Development

No branches or pull requests

3 participants