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

🐛 Bug Report: CERTIFICATE_VERIFY_FAILED on Android 7.0 (Flutter) #4779

Closed
2 tasks done
ronw98 opened this issue Nov 24, 2022 · 1 comment
Closed
2 tasks done

🐛 Bug Report: CERTIFICATE_VERIFY_FAILED on Android 7.0 (Flutter) #4779

ronw98 opened this issue Nov 24, 2022 · 1 comment

Comments

@ronw98
Copy link

ronw98 commented Nov 24, 2022

👟 Reproduction steps

I have a server with a custom domain setup. When I make any api call from a flutter app on Android 7.0 I get an CERTIFICATE_VERIFY_FAILED error. Everything works fine on higher Android versions and other platforms (web, iOS, macOS)

👍 Expected behavior

It should make the API call with the appropriate response

👎 Actual Behavior

I throws the following error
HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: certificate has expired(handshake.cc:393))

After googling it I found this SO question it seems to be a problem related to flutter and Android <7.1

A workaround exists (as stated in the SO thread) but I can't find a way to apply it to the appwrite client.

I think the flutter appwrite library should either implement the workaround or allow for a custom http client.

🎲 Appwrite version

Version 1.1.x

💻 Operating system

Linux

🧱 Your Environment

Appwrite: 1.1.1
Appwrite SDK; Flutter: 8.1.0
Only customization is a custom domain set to the server but it works fine with clients on other platforms

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@ronw98 ronw98 added the bug Something isn't working label Nov 24, 2022
@stnguyen90 stnguyen90 added feature and removed bug Something isn't working labels Dec 1, 2022
@eldadfux
Copy link
Member

I assume you're using a self-hosted instance. If this instance is on your localhost or you're accessing it through your IP. If this is the case, you need to enable the option to set a self-signed certificate.

import io.appwrite.Client
import io.appwrite.services.Account

val client = Client(context)
    .setEndpoint("https://cloud.appwrite.io/v1") // Your Appwrite Endpoint
    .setProject("[PROJECT_ID]") // Your project ID
    .setSelfSigned(true) // Remove in production

While this is completely fine for development, for production, consider using a public domain for your instance that will allow Appwrite to generate a valid certificate for you.

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

3 participants