dart-lang/sdk

Certificate handshake error in client

nex3 opened this issue · 15 comments

nex3 commented

From @tmst on January 19, 2018 20:2

I have no idea how certificates work:

/home/tom/work/dart-sdk/bin/pub get
Resolving dependencies...
Handshake error in client (OS Error:
CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(ssl_cert.c:345))
Process finished with exit code 1

certificate_error.txt
certs.txt

Copied from original issue: dart-lang/pub#1786

nex3 commented

Pub doesn't do anything special with certificates, it just calls out to dart:io. I suspect the underlying issue here is your OS configuration, but I'm going to move this to the SDK repo because the folks there will probably have more expertise with which to help you diagnose the issue.

tmst commented

As I suspected. I think I recall going into Chrome's certificate store some time ago and deleting "trusted" stuff with odd domains or names, figuring the store functioned merely as a cache. Could I have messed something up?

jwren commented

This has been hit recently by Dart Plugin users in both 1.24 and latest 2.0 dev.

I'm going to need more details (OS version and/or distro), and repro instructions.

nex3 commented

I'm not sure why I'm assigned for this. Shouldn't the details come from @tmst?

@zanderso I had no problems before yesterday, but now I have no idea how to proceed. The problem is both with the SDK 1.24.3 and 2.0.0-dev.20.0. I do not remember doing anything special except for installing the regular Windows updates. I have Windows 10.0.16299.214. Steps are:

pub global activate stagehand
pub global run stagehand web-angular
pub get

This is what I get:

Microsoft Windows [Version 10.0.16299.214]
(c) 2017 Microsoft Corporation. All rights reserved.

> pub global activate stagehand
Package stagehand is currently active at version 1.1.8.
Resolving dependencies...
+ args 0.13.7 (1.3.0 available)
+ async 2.0.1 (2.0.3 available)
+ charcode 1.1.1
+ collection 1.14.5
+ http 0.11.3+16
+ http_parser 3.1.1
+ path 1.5.1
+ source_span 1.4.0
+ stagehand 1.1.8
+ string_scanner 1.0.2
+ typed_data 1.1.5
+ usage 3.3.0
Precompiling executables...
Precompiled stagehand:stagehand.
Installed executable stagehand.
Warning: Pub installs executables into C:\Users\alexander.doroshko\AppData\Roaming\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated stagehand 1.1.8.

>pub global run stagehand web-angular
Creating web-angular application `d`:
  C:\temp\d\.gitignore
  C:\temp\d\CHANGELOG.md
  C:\temp\d\README.md
  C:\temp\d\analysis_options.yaml
  C:\temp\d\lib/app_component.css
  C:\temp\d\lib/app_component.dart
  C:\temp\d\lib/app_component.html
  C:\temp\d\lib/src/todo_list/todo_list_component.css
  C:\temp\d\lib/src/todo_list/todo_list_component.dart
  C:\temp\d\lib/src/todo_list/todo_list_component.html
  C:\temp\d\lib/src/todo_list/todo_list_service.dart
  C:\temp\d\pubspec.yaml
  C:\temp\d\test/app_test.dart
  C:\temp\d\web/favicon.png
  C:\temp\d\web/index.html
  C:\temp\d\web/main.dart
  C:\temp\d\web/styles.css
17 files written.

--> to provision required packages, run 'pub get'
--> to run your app, use `pub serve`.

>pub get
Resolving dependencies...
+ analyzer 0.30.0+4 (0.31.0+1 available)
+ angular 4.0.0+2 (5.0.0-alpha+5 available)
+ angular_compiler 0.3.0+1 (0.4.0-alpha+5 available)
+ angular_components 0.8.0 (0.9.0-alpha+4 available)
+ angular_forms 1.0.0 (1.0.1-alpha+5 available)
+ angular_test 1.0.1 (2.0.0-alpha+3 available)
+ ansicolor 0.0.9
+ archive 1.0.33
+ args 0.13.7 (1.3.0 available)
+ async 1.13.3 (2.0.3 available)
+ barback 0.15.2+14
+ boolean_selector 1.0.2
+ browser 0.10.0+2
+ build 0.11.2 (0.12.0+1 available)
+ build_barback 0.4.0+2 (0.5.0+3 available)
+ build_config 0.2.3
+ charcode 1.1.1
+ cli_util 0.1.2+1
+ code_builder 1.0.4 (3.0.1 available)
+ code_transformers 0.5.1+4
+ collection 1.14.5
+ convert 2.0.1
+ crypto 2.0.2+1
+ csslib 0.14.1
+ dart_style 1.0.9+1
+ dart_to_js_script_rewriter 1.0.3
+ fixnum 0.10.7
+ front_end 0.1.0-alpha.4.1 (0.1.0-alpha.8 available)
+ func 1.0.0
+ glob 1.1.5
+ html 0.13.2+2
+ http 0.11.3+16
+ http_multi_server 2.0.4
+ http_parser 3.1.1
+ intl 0.15.2
+ io 0.3.2+1
+ isolate 1.1.0
+ js 0.6.1
+ kernel 0.3.0-alpha.1.1 (0.3.0-alpha.5 available)
+ logging 0.11.3+1
+ matcher 0.12.1+4
+ meta 1.1.2
+ mime 0.9.5 (0.9.6 available)
+ multi_server_socket 1.0.1
+ node_preamble 1.4.0
+ observable 0.20.4+3
+ package_config 1.0.3
+ package_resolver 1.0.2
+ pageloader 2.2.6
+ path 1.5.1
+ perf_api 0.1.0
+ plugin 0.2.0+2
+ pool 1.3.4
+ pub_semver 1.3.2
+ quiver 0.25.0 (0.28.0 available)
+ quiver_hashcode 1.0.0
+ sass 1.0.0-beta.5.2
+ sass_builder 1.1.2
+ scratch_space 0.0.1+3
+ shelf 0.7.2
+ shelf_packages_handler 1.0.3
+ shelf_static 0.2.7
+ shelf_web_socket 0.2.2
+ source_gen 0.7.4+3
+ source_map_stack_trace 1.1.4
+ source_maps 0.10.4
+ source_span 1.4.0
+ stack_trace 1.9.1
+ stream_channel 1.6.3
+ string_scanner 1.0.2
+ term_glyph 1.0.0
+ test 0.12.30+2
+ tuple 1.0.1
+ typed_data 1.1.5
+ unittest 0.11.7 (0.12.4+1 available)
+ utf 0.9.0+3 (0.9.0+4 available)
+ uuid 0.5.3
+ watcher 0.9.7+6 (0.9.7+7 available)
+ web_socket_channel 1.0.6
+ webdriver 1.2.3 (2.0.0-beta available)
+ yaml 2.1.13
Downloading sass_builder 1.1.2...
Downloading scratch_space 0.0.1+3...
Downloading build_config 0.2.3...
Downloading build_barback 0.4.0+2...
Downloading build 0.11.2...
Downloading sass 1.0.0-beta.5.2...
Downloading fixnum 0.10.7...
Downloading dart_style 1.0.9+1...
Downloading code_transformers 0.5.1+4...
Downloading source_gen 0.7.4+3...
Downloading test 0.12.30+2...
Handshake error in client (OS Error:
        CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(ssl_cert.c:345))

Update: I've manually deleted Pub cache and now I get the error earlier:

>pub global activate stagehand
Resolving dependencies...
+ args 0.13.7 (1.3.0 available)
+ async 2.0.3
+ charcode 1.1.1
+ collection 1.14.5
+ http 0.11.3+16
+ http_parser 3.1.1
+ path 1.5.1
+ source_span 1.4.0
+ stagehand 1.1.8
+ string_scanner 1.0.2
+ typed_data 1.1.5
+ usage 3.3.0
Downloading stagehand 1.1.8...
Downloading usage 3.3.0...
Downloading path 1.5.1...
Downloading http 0.11.3+16...
Downloading http_parser 3.1.1...
Downloading charcode 1.1.1...
Downloading typed_data 1.1.5...
Downloading string_scanner 1.0.2...
Downloading source_span 1.4.0...
Downloading collection 1.14.5...
Downloading async 2.0.3...
Downloading args 0.13.7...
Handshake error in client (OS Error:
        CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(ssl_cert.c:345))

Attaching verbose pub output: pub_verbose.txt

On a different Windows machine with the same OS and the same OS updates installed it still works fine. So I guess something might be messed up on my machine but I have no idea what. I know that I didn't play manually with certificates. I have Kaspersky Antivirus installed, not sure if it is related. Disabling it doesn't help and it is installed for more than 2 years.
@tmst, @tomialagbe, did you find the cause of the problem?

I couldn't find the cause of the issue. I ended up resetting my Windows installation.

Thanks for the info! I'll try to repro on my Windows box.

Let's track the Windows SSL errors here: #32131

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

For me, error disappeared after I explicitly ran cmd promt with anadministrator privileges.

@zanderso I had no problems before yesterday, but now I have no idea how to proceed. The problem is both with the SDK 1.24.3 and 2.0.0-dev.20.0. I do not remember doing anything special except for installing the regular Windows updates. I have Windows 10.0.16299.214. Steps are:

pub global activate stagehand
pub global run stagehand web-angular
pub get

This is what I get:

Microsoft Windows [Version 10.0.16299.214]
(c) 2017 Microsoft Corporation. All rights reserved.

> pub global activate stagehand
Package stagehand is currently active at version 1.1.8.
Resolving dependencies...
+ args 0.13.7 (1.3.0 available)
+ async 2.0.1 (2.0.3 available)
+ charcode 1.1.1
+ collection 1.14.5
+ http 0.11.3+16
+ http_parser 3.1.1
+ path 1.5.1
+ source_span 1.4.0
+ stagehand 1.1.8
+ string_scanner 1.0.2
+ typed_data 1.1.5
+ usage 3.3.0
Precompiling executables...
Precompiled stagehand:stagehand.
Installed executable stagehand.
Warning: Pub installs executables into C:\Users\alexander.doroshko\AppData\Roaming\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated stagehand 1.1.8.

>pub global run stagehand web-angular
Creating web-angular application `d`:
  C:\temp\d\.gitignore
  C:\temp\d\CHANGELOG.md
  C:\temp\d\README.md
  C:\temp\d\analysis_options.yaml
  C:\temp\d\lib/app_component.css
  C:\temp\d\lib/app_component.dart
  C:\temp\d\lib/app_component.html
  C:\temp\d\lib/src/todo_list/todo_list_component.css
  C:\temp\d\lib/src/todo_list/todo_list_component.dart
  C:\temp\d\lib/src/todo_list/todo_list_component.html
  C:\temp\d\lib/src/todo_list/todo_list_service.dart
  C:\temp\d\pubspec.yaml
  C:\temp\d\test/app_test.dart
  C:\temp\d\web/favicon.png
  C:\temp\d\web/index.html
  C:\temp\d\web/main.dart
  C:\temp\d\web/styles.css
17 files written.

--> to provision required packages, run 'pub get'
--> to run your app, use `pub serve`.

>pub get
Resolving dependencies...
+ analyzer 0.30.0+4 (0.31.0+1 available)
+ angular 4.0.0+2 (5.0.0-alpha+5 available)
+ angular_compiler 0.3.0+1 (0.4.0-alpha+5 available)
+ angular_components 0.8.0 (0.9.0-alpha+4 available)
+ angular_forms 1.0.0 (1.0.1-alpha+5 available)
+ angular_test 1.0.1 (2.0.0-alpha+3 available)
+ ansicolor 0.0.9
+ archive 1.0.33
+ args 0.13.7 (1.3.0 available)
+ async 1.13.3 (2.0.3 available)
+ barback 0.15.2+14
+ boolean_selector 1.0.2
+ browser 0.10.0+2
+ build 0.11.2 (0.12.0+1 available)
+ build_barback 0.4.0+2 (0.5.0+3 available)
+ build_config 0.2.3
+ charcode 1.1.1
+ cli_util 0.1.2+1
+ code_builder 1.0.4 (3.0.1 available)
+ code_transformers 0.5.1+4
+ collection 1.14.5
+ convert 2.0.1
+ crypto 2.0.2+1
+ csslib 0.14.1
+ dart_style 1.0.9+1
+ dart_to_js_script_rewriter 1.0.3
+ fixnum 0.10.7
+ front_end 0.1.0-alpha.4.1 (0.1.0-alpha.8 available)
+ func 1.0.0
+ glob 1.1.5
+ html 0.13.2+2
+ http 0.11.3+16
+ http_multi_server 2.0.4
+ http_parser 3.1.1
+ intl 0.15.2
+ io 0.3.2+1
+ isolate 1.1.0
+ js 0.6.1
+ kernel 0.3.0-alpha.1.1 (0.3.0-alpha.5 available)
+ logging 0.11.3+1
+ matcher 0.12.1+4
+ meta 1.1.2
+ mime 0.9.5 (0.9.6 available)
+ multi_server_socket 1.0.1
+ node_preamble 1.4.0
+ observable 0.20.4+3
+ package_config 1.0.3
+ package_resolver 1.0.2
+ pageloader 2.2.6
+ path 1.5.1
+ perf_api 0.1.0
+ plugin 0.2.0+2
+ pool 1.3.4
+ pub_semver 1.3.2
+ quiver 0.25.0 (0.28.0 available)
+ quiver_hashcode 1.0.0
+ sass 1.0.0-beta.5.2
+ sass_builder 1.1.2
+ scratch_space 0.0.1+3
+ shelf 0.7.2
+ shelf_packages_handler 1.0.3
+ shelf_static 0.2.7
+ shelf_web_socket 0.2.2
+ source_gen 0.7.4+3
+ source_map_stack_trace 1.1.4
+ source_maps 0.10.4
+ source_span 1.4.0
+ stack_trace 1.9.1
+ stream_channel 1.6.3
+ string_scanner 1.0.2
+ term_glyph 1.0.0
+ test 0.12.30+2
+ tuple 1.0.1
+ typed_data 1.1.5
+ unittest 0.11.7 (0.12.4+1 available)
+ utf 0.9.0+3 (0.9.0+4 available)
+ uuid 0.5.3
+ watcher 0.9.7+6 (0.9.7+7 available)
+ web_socket_channel 1.0.6
+ webdriver 1.2.3 (2.0.0-beta available)
+ yaml 2.1.13
Downloading sass_builder 1.1.2...
Downloading scratch_space 0.0.1+3...
Downloading build_config 0.2.3...
Downloading build_barback 0.4.0+2...
Downloading build 0.11.2...
Downloading sass 1.0.0-beta.5.2...
Downloading fixnum 0.10.7...
Downloading dart_style 1.0.9+1...
Downloading code_transformers 0.5.1+4...
Downloading source_gen 0.7.4+3...
Downloading test 0.12.30+2...
Handshake error in client (OS Error:
        CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(ssl_cert.c:345))

i found the solution of it: just open environment variables and add that path <<C:\Users\alexander.doroshko\AppData\Roaming\Pub\Cache\bin>>
to your path in user variables card.