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

Certificate verify failed on mobile application #45

Closed
BadisB opened this issue Aug 20, 2020 · 1 comment
Closed

Certificate verify failed on mobile application #45

BadisB opened this issue Aug 20, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@BadisB
Copy link

BadisB commented Aug 20, 2020

Hello,

First of all thank you for the big work behind this API!

I am developping a Flutter application using the Trefle API, on my android phone when waiting for a response from the API I get this error in the console:

Unhandled Exception: HandshakeException: Handshake error in client (OS Error:
CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354))

I searched for the certificate using the Chrome or Firefox app on my phone and it seems that trefle.io is using a HSTS technology for the certificate as described here:

Le site www.trefle.io est actuellement inaccessible, car il utilise la technologie HSTS. Les erreurs réseau et les attaques sont généralement temporaires. Vous devriez donc pouvoir accéder à cette page plus tard.

Let's say I search a plant on my app, say "basil", the uri would look like that:

https://trefle.io/api/v1/plants?token=[PERSONAL_KEY]&q=basil

If I type it directly on Chrome or Firefox (desktop) I get a JSON.
If I type it from my android mobile phone Chrome or Firefox I get a certificate issue.

What's wrong? Do you think it has a issue with https instead of http?

@BadisB BadisB added the bug Something isn't working label Aug 20, 2020
@BadisB
Copy link
Author

BadisB commented Aug 21, 2020

Hello again, fixed the issue by editing my code. Made a mistake by having the url including "www".

It must be in the form of:
https://trefle.io/api/v1/plants?token=[PERSONAL_KEY]&q=basil

and not:
https://www.trefle.io/api/v1/plants?token=[PERSONAL_KEY]&q=basil

@BadisB BadisB closed this as completed Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants