dart pub get CERTIFICATE_VERIFY_FAILED

Issue

I recently upgraded a project from 1.22.1 to 1.24.3. Subsequently, pub get has failed with either

Handshake error in client (OS Error:
CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(ssl_cert.c:345))

or

Handshake error in client (OS Error: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED)

I’ve found similar threads about getting this error, but none of the solutions given in those threads seem to have fixed the issue. I ran pub –trace –verbosity all get as requested in those threads, output here

The less verbose output from Webstorm’s console is

    Working dir: C:\SGGDev\pearls\client
    C:\DevTools\dart-sdk-1-24-3\bin\pub.bat get
    Resolving dependencies...
    Downloading uuid 0.5.3...
    Downloading convert 2.0.1...
    Downloading charcode 1.1.1...
    Downloading crypto 2.0.2+1...
    Downloading collection 1.14.3...
    Downloading typed_data 1.1.5...
    Downloading xml 2.6.0...
    Downloading petitparser 1.6.1...
    Downloading matcher 0.12.1+2...
    Downloading stack_trace 1.8.0...
    Downloading path 1.4.2...
    Handshake error in client (OS Error: 
        CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(ssl_cert.c:345))
    Process finished with exit code 1

Before I deleted the pub cache in appdata, a suggested solution, the same error was encountered almost immediately, after the first or second package.

Solution

For me the error was caused by my antivirus, i had to disable it to make Dart works.

Answered By – Rémy Menard

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.