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: application verification failure #1895

Closed
sebastianbuechler opened this issue Jul 12, 2023 · 8 comments
Closed

CERTIFICATE_VERIFY_FAILED: application verification failure #1895

sebastianbuechler opened this issue Jul 12, 2023 · 8 comments

Comments

@sebastianbuechler
Copy link

Package

dio

Version

5.2.1+1

Output of flutter doctor -v

[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.22621.1848], locale de-CH)
    • Flutter version 3.10.5 on channel stable at C:\src\flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (4 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\sbj98\AppData\Local\Android\sdk
    • Platform android-33-ext4, build-tools 33.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.23)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.33214.272
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)

[√] VS Code (version 1.80.0)
    • VS Code at C:\Users\sbj98\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.68.0

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 12 (API 31) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22621.1848]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 114.0.5735.134
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 114.0.1823.79

[√] Network resources
    • All expected network resources are available.

• No issues found!

Dart Version

3.0.5

Steps to Reproduce

  1. Setup a normal Dio instance
  2. Do a request with a method like await dio.get("request path")
  3. Get error on handshake

Expected Result

Handshake should happen successfully as usual.

Actual Result

Since one month approximately we see from time to time that dio throws an error like this:

DioException
DioException [unknown]: null
Error: HandshakeException: Handshake error in client (OS Error: 
	CERTIFICATE_VERIFY_FAILED: application verification failure(handshake.cc:393))

Stacktrace:
dio_mixin.dart in DioMixin.fetch. at line 533 within dio
Called from: zone.dart in _rootRunUnary

I checked our api certificates and they seem fine, as they won't expire for another month and the browser also do not complain when checking the certificates.

What does "application verification failure" even mean?

@sebastianbuechler sebastianbuechler added h: need triage This issue needs to be categorized s: bug Something isn't working labels Jul 12, 2023
@kuhnroyal
Copy link
Member

I don't think there is anything Dio can do here. You are probably on a device where the certificate store is outdated.

@sebastianbuechler
Copy link
Author

I don't think there is anything Dio can do here. You are probably on a device where the certificate store is outdated.

Wouldn't that be a different error? How can I find out more about this?

@kuhnroyal
Copy link
Member

Why? The error says you certificate is not valid. If you think it is valid, then something is wrong somewhere in between.

In any case, this is an OS error coming from the Dart VM, has nothing to do with Dio AFAIK.

@sebastianbuechler
Copy link
Author

Why? The error says you certificate is not valid. If you think it is valid, then something is wrong somewhere in between.

In any case, this is an OS error coming from the Dart VM, has nothing to do with Dio AFAIK.

No, the error says "application verification failure". I know the certificate is valid because in 99% of the calls to this api the error does not appear.

@kuhnroyal
Copy link
Member

The error says CERTIFICATE_VERIFY_FAILED by the client (application) - your app.
In any case, this is an OS error coming from the Dart VM - I suggest looking at issues in the Dart SDK repository. Try to figure out if this only happens on some devices/OS.

@AlexV525
Copy link
Member

Closing as #1895 (comment).

@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2023
@AlexV525 AlexV525 added i: out of support and removed h: need triage This issue needs to be categorized s: bug Something isn't working labels Jul 15, 2023
@chenkaiHere
Copy link

I also encountered this problem,
I have a domain name and an ip. They both have certificates and are valid. The domain name address can be requested normally, but the pure ip cannot be successfully requested. Dio will prompt CERTIFICATE_VERIFY_FAILED as an exception.

@kuhnroyal
Copy link
Member

Again, this is nothing Dio is doing. Dio is using the HttpClient from the Dart SDK. Please check for open issues and resolutions there. Possibly give the dio_native_adapter a try and see if that gives you different results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants