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

pub get on the samples (sunflower, pop_pop_win, etc) fail with peer certificate error #983

Closed
DartBot opened this issue Jun 5, 2015 · 37 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

Originally opened as dart-lang/sdk#18929

This issue was originally filed by [email protected]


What steps will reproduce the problem?

  1. go to the sample directory containing pop_pop_win
  2. enter command 'pub get'
  3. see error "Peer's Certificate Issuer is not recognized., errno = -8179)

What is the expected output? What do you see instead?
I expect pub to get the required files

What version of the product are you using? On what operating system?
Dart sdk 1.3.6

Please provide any additional information below.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/3276024?v=3" align="left" width="48" height="48"hspace="10"> Comment by anders-sandholm


Added Area-Pub, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


All the HTTPS certificate stuff is handled by dart:io.


Removed Area-Pub label.
Added Library-IO, Area-Library labels.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/22043?v=3" align="left" width="48" height="48"hspace="10"> Comment by skabet


Hi,

Dart comes with a built-in CA database, so what happens here is that the certificate of the host is not accepted by that database. To me it sounds like the request is rewritten and another certificate is used, than the one expected (that is, the certificate used it not the one for 'pub.dartlang.org').

Can you try to run the following:

  pub --trace --verbosity all get

That might help us see if there is anything wrong with the local setup.

Cheers,

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This comment was originally written by [email protected]


C:\dev\tools\dart\dart64\samples\sunflower>pub --trace --verbosity all get
FINE: Pub 1.4.0-dev.6.9
IO : Spawning "cmd /c ver" in C:\dev\tools\dart\dart64\samples\sunflower.
IO : Finished ver. Exit code 0.
    | stdout:
    | |
    | | Microsoft Windows [Version 6.1.7601]
    | Nothing output on stderr.
Resolving dependencies... (0.0s)
SLVR: Solving dependencies:
    | - browser >=0.9.0 <0.10.0 from hosted (browser)
IO : Get versions from https://pub.dartlang.org/api/packages/browser.
FINE: HTTP GET https://pub.dartlang.org/api/packages/browser
    | Accept: application/vnd.pub.v2+json
    | user-agent: Dart pub 1.4.0-dev.6.9
SLVR: Could not get versions for browser >=0.9.0 <0.10.0 from hosted (browser):
    | HandshakeException: Handshake error in client (OS Error: Peer's Certificate issuer is not recognized., errno = -8179)
    |
    | package:stack_trace/src/stack_zone_specification.dart 90 StackZoneSpecification.trackFuture.<fn>
    | package:stack_trace/src/stack_zone_specification.dart 140 registerBinaryCallback.<fn>.<fn>
    | package:stack_trace/src/stack_zone_specification.dart 185 StackZoneSpecification._run
    | package:stack_trace/src/stack_zone_specification.dart 140 registerBinaryCallback.<fn>
    | dart:async/zone.dart 742 _rootRunBinary
    | dart:async/zone.dart 471 _ZoneDelegate.runBinary
    | dart:async/zone.dart 671 _CustomizedZone.runBinary
    | dart:async/future_impl.dart 516 _Future._propagateToListeners.handleError
    | dart:async/future_impl.dart 574 _Future._propagateToListeners
    | dart:async/future_impl.dart 343 _Future._completeError
    | dart:async/future_impl.dart 406 _Future._asyncCompleteError.<fn>
    | package:stack_trace/src/stack_zone_specification.dart 185 StackZoneSpecification._run
    | package:stack_trace/src/stack_zone_specification.dart 119 registerCallback.<fn>
    | dart:async/zone.dart 723 _rootRun
    | dart:async/zone.dart 453 _ZoneDelegate.run
    | dart:async/zone.dart 663 _CustomizedZone.run
    | dart:async/zone.dart 574 _BaseZone.runGuarded
    | dart:async/zone.dart 599 _BaseZone.bindCallback.<fn>
    | dart:async/schedule_microtask.dart 23 _asyncRunCallbackLoop
    | dart:async/schedule_microtask.dart 32 _asyncRunCallback
    | dart:isolate-patch/isolate_patch.dart 128 _RawReceivePortImpl._handleMessage
IO : Get versions from https://pub.dartlang.org/api/packages/browser.
FINE: HTTP GET https://pub.dartlang.org/api/packages/browser
    | Accept: application/vnd.pub.v2+json
    | user-agent: Dart pub 1.4.0-dev.6.9
SLVR: BacktrackingSolver took 0:00:00.524000 seconds.
    | - Requested 2 version lists
    | - Looked up 0 cached version lists
    | - Requested 0 pubspecs
    | - Looked up 1 cached pubspecs
    |
FINE: Clean up system cache temp directory C:\Users\av\AppData\Roaming\Pub\Cache_temp.
ERR : Handshake error in client (OS Error: Peer's Certificate issuer is not recognized., errno = -8179)
FINE: Exception type: HandshakeException
ERR : package:http/src/io_client.dart 32 IOClient.send
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\http.dart 70 PubHttpClient.send
    | package:http/src/base_client.dart 150 BaseClient._sendUns
treamed.<fn>
    | dart:async Future.Future.sync
    | package:http/src/utils.dart 201 syncFuture
    | package:http/src/base_client.dart 132 BaseClient._sendUns
treamed
    | package:http/src/base_client.dart 35 BaseClient.get
    | package:http/src/base_client.dart 98 BaseClient.read
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\source\hosted.dart 43 HostedSource.getVer
sions
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\version_solver.dart 181 PubspecCache.getVer
sions
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 571 Traverser._getAllow
edVersions
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 560 Traverser._traverse
Deps.<fn>.<fn>.<fn>
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\version_queue.dart 87 VersionQueue._calcu
lateAllowed
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\version_queue.dart 59 VersionQueue.create

    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 559 Traverser._traverse
Deps.<fn>.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 507 Traverser._traverse
Deps.<fn>
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 712 resetStack
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 506 Traverser._traverse
Deps
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 492 Traverser._traverse
Package.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 461 Traverser._traverse
Package
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 439 Traverser.traverse
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 220 BacktrackingSolver.
_traverseSolution.<fn>
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 712 resetStack
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 219 BacktrackingSolver.
_traverseSolution
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 134 BacktrackingSolver.
solve.<fn>
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 127 BacktrackingSolver.
solve
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\version_solver.dart 37 resolveVersions.<fn

    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\log.dart 230 progress
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\version_solver.dart 35 resolveVersions
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\entrypoint.dart 121 Entrypoint.acquireD
ependencies.<fn>
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 90 syncFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\entrypoint.dart 120 Entrypoint.acquireD
ependencies
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\command\get.dart 25 onRun
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 90 syncFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\command.dart 178 PubCommand.run
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\bin\pub.dart 198 invokeCommand.<fn>
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 90 syncFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\bin\pub.dart 197 invokeCommand
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\bin\pub.dart 87 runPub.<fn>
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 102 captureErrors.<fn>
    | package:stack_trace/src/chain.dart 93 Chain.capture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 116 captureErrors
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\bin\pub.dart 87 runPub
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\bin\pub.dart 74 main.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage

---- Log transcript ----
FINE: Pub 1.4.0-dev.6.9
IO : Spawning "cmd /c ver" in C:\dev\tools\dart\dart64\samples\sunflower.
IO : Finished ver. Exit code 0.
    | stdout:
    | |
    | | Microsoft Windows [Version 6.1.7601]
    | Nothing output on stderr.
SLVR: Solving dependencies:
    | - browser >=0.9.0 <0.10.0 from hosted (browser)
IO : Get versions from https://pub.dartlang.org/api/packages/browser.
FINE: HTTP GET https://pub.dartlang.org/api/packages/browser
    | Accept: application/vnd.pub.v2+json
    | user-agent: Dart pub 1.4.0-dev.6.9
SLVR: Could not get versions for browser >=0.9.0 <0.10.0 from hosted (browser):
    | HandshakeException: Handshake error in client (OS Error: Peer's Certificate issuer is not recognized., errno = -8179)
    |
    | package:stack_trace/src/stack_zone_specification.dart 90 StackZoneSpecification.trackFuture.<fn>
    | package:stack_trace/src/stack_zone_specification.dart 140 registerBinaryCallback.<fn>.<fn>
    | package:stack_trace/src/stack_zone_specification.dart 185 StackZoneSpecification._run
    | package:stack_trace/src/stack_zone_specification.dart 140 registerBinaryCallback.<fn>
    | dart:async/zone.dart 742 _rootRunBinary
    | dart:async/zone.dart 471 _ZoneDelegate.runBinary
    | dart:async/zone.dart 671 _CustomizedZone.runBinary
    | dart:async/future_impl.dart 516 _Future._propagateToListeners.handleError
    | dart:async/future_impl.dart 574 _Future._propagateToListeners
    | dart:async/future_impl.dart 343 _Future._completeError
    | dart:async/future_impl.dart 406 _Future._asyncCompleteError.<fn>
    | package:stack_trace/src/stack_zone_specification.dart 185 StackZoneSpecification._run
    | package:stack_trace/src/stack_zone_specification.dart 119 registerCallback.<fn>
    | dart:async/zone.dart 723 _rootRun
    | dart:async/zone.dart 453 _ZoneDelegate.run
    | dart:async/zone.dart 663 _CustomizedZone.run
    | dart:async/zone.dart 574 _BaseZone.runGuarded
    | dart:async/zone.dart 599 _BaseZone.bindCallback.<fn>
    | dart:async/schedule_microtask.dart 23 _asyncRunCallbackLoop
    | dart:async/schedule_microtask.dart 32 _asyncRunCallback
    | dart:isolate-patch/isolate_patch.dart 128 _RawReceivePortImpl._handleMessage
IO : Get versions from https://pub.dartlang.org/api/packages/browser.
FINE: HTTP GET https://pub.dartlang.org/api/packages/browser
    | Accept: application/vnd.pub.v2+json
    | user-agent: Dart pub 1.4.0-dev.6.9
SLVR: BacktrackingSolver took 0:00:00.524000 seconds.
    | - Requested 2 version lists
    | - Looked up 0 cached version lists
    | - Requested 0 pubspecs
    | - Looked up 1 cached pubspecs
    |
FINE: Clean up system cache temp directory C:\Users\av\AppData\Roaming\Pub\Cache_temp.
ERR : Handshake error in client (OS Error: Peer's Certificate issuer is not recognized., errno = -8179)
FINE: Exception type: HandshakeException
ERR : package:http/src/io_client.dart 32 IOClient.send
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\http.dart 70 PubHttpClient.send
    | package:http/src/base_client.dart 150 BaseClient._sendUns
treamed.<fn>
    | dart:async Future.Future.sync
    | package:http/src/utils.dart 201 syncFuture
    | package:http/src/base_client.dart 132 BaseClient._sendUns
treamed
    | package:http/src/base_client.dart 35 BaseClient.get
    | package:http/src/base_client.dart 98 BaseClient.read
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\source\hosted.dart 43 HostedSource.getVer
sions
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\version_solver.dart 181 PubspecCache.getVer
sions
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 571 Traverser._getAllow
edVersions
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 560 Traverser._traverse
Deps.<fn>.<fn>.<fn>
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\version_queue.dart 87 VersionQueue._calcu
lateAllowed
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\version_queue.dart 59 VersionQueue.create

    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 559 Traverser._traverse
Deps.<fn>.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 507 Traverser._traverse
Deps.<fn>
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 712 resetStack
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 506 Traverser._traverse
Deps
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 492 Traverser._traverse
Package.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 461 Traverser._traverse
Package
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 439 Traverser.traverse
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 220 BacktrackingSolver.
_traverseSolution.<fn>
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 712 resetStack
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 219 BacktrackingSolver.
_traverseSolution
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 134 BacktrackingSolver.
solve.<fn>
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage
    | ===== asynchronous gap ===========================
    | dart:async _Future.then
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 86 newFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\backtracking_solver.dart 127 BacktrackingSolver.
solve
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\version_solver.dart 37 resolveVersions.<fn

    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\log.dart 230 progress
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\solver\version_solver.dart 35 resolveVersions
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\entrypoint.dart 121 Entrypoint.acquireD
ependencies.<fn>
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 90 syncFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\entrypoint.dart 120 Entrypoint.acquireD
ependencies
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\command\get.dart 25 onRun
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 90 syncFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\command.dart 178 PubCommand.run
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\bin\pub.dart 198 invokeCommand.<fn>
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 90 syncFuture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\bin\pub.dart 197 invokeCommand
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\bin\pub.dart 87 runPub.<fn>
    | dart:async Future.Future.sync
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 102 captureErrors.<fn>
    | package:stack_trace/src/chain.dart 93 Chain.capture
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\lib\src\utils.dart 116 captureErrors
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\bin\pub.dart 87 runPub
    | e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib_internal\pub\bin\pub.dart 74 main.<fn>
    | dart:isolate _RawReceivePortImpl
._handleMessage

---- End log transcript ----

C:\dev\tools\dart\dart64\samples\sunflower>

@DartBot DartBot added type-enhancement A request for a change that isn't a bug closed-not-planned Closed as we don't intend to take action on the reported issue labels Jun 5, 2015
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/1343914?v=3" align="left" width="48" height="48"hspace="10"> Comment by sgjesse


Hi,

So it seems that the certificate from pub.dartlang.org is somehow not recognized. Can you run the following Dart code to get more information on the certificate the Dart client is seeing:

import 'dart:io';

printCertificate(cert) {
  print('${cert.issuer}');
  print('${cert.subject}');
  print('${cert.startValidity}');
  print('${cert.endValidity}');
}

main() {
  var client = new HttpClient();
  client.badCertificateCallback = (cert, host, port) {
    print('Bad certificate connecting to $host:$port:');
    printCertificate(cert);
    print('');
    return true;
  };
  client.getUrl(Uri.parse('https://pub.dartlang.org/api/packages/browser'))
      .then((request) => request.close())
      .then((response) {
        print('Response certificate:');
        printCertificate(response.certificate);
        response.drain();
        client.close();
      });
}

Thanks,
Søren

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This comment was originally written by [email protected]


Ok, got this back. The zzz and xyz are instead of the actual name returned.

Observatory listening on http://127.0.0.1:51829
Bad certificate connecting to pub.dartlang.org:443:
CN=ZZZSubEntCA,DC=zzz,DC=xyz,DC=local
CN=*.dartlang.org,O=Google Inc,L=Mountain View,ST=California,C=US
2013-09-30 01:07:15.000
2014-09-30 01:07:15.000

Response certificate:
CN=ZZZSubEntCA,DC=zzz,DC=xyz,DC=local
CN=*.dartlang.org,O=Google Inc,L=Mountain View,ST=California,C=US
2013-09-30 01:07:15.000
2014-09-30 01:07:15.000

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/1343914?v=3" align="left" width="48" height="48"hspace="10"> Comment by sgjesse


When I run this program locally I get:

Response certificate:
CN=Google Internet Authority G2,O=Google Inc,C=US
CN=*.dartlang.org,O=Google Inc,L=Mountain View,ST=California,C=US
2013-09-30 10:07:15.000
2014-09-30 10:07:15.000

Which have a Google root certificate.

This looks like there is a corporate proxy between your machine and pub.dartlang.org which is terminating the HTTPS connection. This proxy is using a root certificate which is not trusted by Dart. The dart executable has a built-in set of root certificates. which of cause does not include this root certificate.

There are a number of ways this can be fixed:

  1. Add an option to 'pub get' to use HTTP instead of HTTPS.
  2. Add an option to 'pub get' to provide an alternative certificate database

Removed Type-Defect, Library-IO, Area-Library labels.
Added Type-Enhancement, Area-Pub, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/1343914?v=3" align="left" width="48" height="48"hspace="10"> Comment by sgjesse


Issue dart-lang/sdk#17664 has been merged into this issue.

1 similar comment
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/1343914?v=3" align="left" width="48" height="48"hspace="10"> Comment by sgjesse


Issue dart-lang/sdk#17664 has been merged into this issue.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


I think it's the OS's responsibility to manage trusted root certificates, rather than each application's. On Windows, it looks like this page has instructions for doing so: http://technet.microsoft.com/en-us/library/cc754841.aspx.


Added NotPlanned label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This comment was originally written by [email protected]


How would we get the cert to add it to our cert storage?

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


There are a couple ways listed here: http://superuser.com/questions/97201/how-to-save-a-remote-server-ssl-certificate-locally-as-a-file

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/713559?v=3" align="left" width="48" height="48"hspace="10"> Comment by Emasoft


1 - Dart should always use HTTPS for pub get. Security issues would be HUGE if it doesn't.

2 - Dart should give a much more informative error message than the one reported above. The error message should explain clearly what does't work and what is the correct way to do it with Dart.

3 - The user must not be forced to manually set the server certificates using the OS. An admin should be able to write scripts in Dart that do it automatically if he needs to setup of a new server. Dart should be able to manage trusted root certificates on every platform it runs, provided it has be granted the necessary privileges. The Dart subsystem should abstracting the different OSs procedures for doing it, and provide classes dedicated to download, verify, install and manage certificates. This should be true for almost all server side scripting tasks involving the OS, at least those tasks needed to be able to write a Dart script that automate the full setup of a new HTTPS server remotely, a common task that before was accomplished using a mix of various tools and scripts.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


Dart should always use HTTPS for pub get. Security issues would be HUGE if it doesn't.

The default is to use HTTPS, but we won't force users to use it for their own custom servers. For intranet or localhost servers, HTTPS doesn't make sense.

Dart should give a much more informative error message than the one reported above. The error message should explain clearly what does't work and what is the correct way to do it with Dart.

Feel free to file an issue against dart:io for this.

The user must not be forced to manually set the server certificates using the OS. An admin should be able to write scripts in Dart that do it automatically if he needs to setup of a new server. Dart should be able to manage trusted root certificates on every platform it runs, provided it has be granted the necessary privileges. The Dart subsystem should abstracting the different OSs procedures for doing it, and provide classes dedicated to download, verify, install and manage certificates. This should be true for almost all server side scripting tasks involving the OS, at least those tasks needed to be able to write a Dart script that automate the full setup of a new HTTPS server remotely, a common task that before was accomplished using a mix of various tools and scripts.

I don't think it's the responsibility of the core SDK, much less the package manager, to support a powerful configuration system. If this is something you'd find valuable, though, feel free to write this yourself.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/1343914?v=3" align="left" width="48" height="48"hspace="10"> Comment by sgjesse


The Dart executable cannot use the certificates which is set up through the OS tools/UI.

The Dart executable uses Mozilla NSS to implement SSL/TLS. NSS access certificates and keys from a database which can be build using the certutil tool (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Reference/NSS_tools_:_certutil).

The API SecureSocket.initialize is used to initialize NSS with a database. If NSS is not initialized with a database a builtin set of trusted roots will be used.

For pub to work with root certificates not in this builtin set of trusted roots an option is needed for the database to use for the call to SecureSocket.initialize.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/1343914?v=3" align="left" width="48" height="48"hspace="10"> Comment by sgjesse


Issue dart-lang/sdk#20270 has been merged into this issue.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


The Dart executable cannot use the certificates which is set up through the OS tools/UI.

Why not?

For pub to work with root certificates not in this builtin set of trusted roots an option is needed for the database to use for the call to SecureSocket.initialize.

If this is a global property of dart:io, shouldn't the "dart" executable expose a way to configure it globally? Why is it the job of each individual executable to expose its own means of configuration?

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/1343914?v=3" align="left" width="48" height="48"hspace="10"> Comment by sgjesse


The Dart executable cannot use the certificates which is set up through the OS tools/UI.

Why not?

We are using the Mozilla NSS library which only supports certificates stored in their own database format.

For pub to work with root certificates not in this builtin set of trusted roots an option is needed for the database to use for the call to SecureSocket.initialize.

If this is a global property of dart:io, shouldn't the "dart" executable expose a way to configure it globally? Why is it the job of each individual executable to expose its own means of configuration?

Right now this is initialized like this

  SecureSocket.initialize(database: 'path/to/database', password: 'password');

We could make this configurable through an environment variable, and for a database with trusted root certificates an empty password should do.

However this still require that the user builds a NSS database with the 'certutil' tool from Mozilla which is complicated (see http://stackoverflow.com/questions/25388750/dart-https-request-with-ssl-certificate-please for an example).

Another option is to use the badCertificateCallback property of dart:io HttpClient (https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-io.HttpClient#id_badCertificateCallback=).

There can either be an option to pub to ignore bad certificates or a prompt displaying the actual certificate and asking.

Of cause this will somehow cause dart:io features to "leak" into the http package.

I don't like an environment variable to ignore all bad certificates in dart:io HttpClient.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


We are using the Mozilla NSS library which only supports certificates stored in their own database format.

Why are we using this library if it imposes such a heavy usability cost for both users and developers?

We could make this configurable through an environment variable, and for a database with trusted root certificates an empty password should do.

This would be better than the current situation, since at least it would mean that Dart executables wouldn't have to independently implement different ways of setting the certificate store.

However this still require that the user builds a NSS database with the 'certutil' tool from Mozilla which is complicated (see http://stackoverflow.com/questions/25388750/dart-https-request-with-ssl-certificate-please for an example).

This is unfortunate, but currently there's no way around it unless we want to ignore bad certificates (which we don't).

@alexpaluzzi
Copy link

Why was this closed? Are we just giving up on the whole idea of using the environment variable or something?

I take a short break from Dart and come back to evaluate it for a project at my company (a big one) and this issue pretty much writes off Dart before I can get anyone to take a second look.

My company has an HTTPS inspection point downstream. This is not a software firewall and it's not something we can add exceptions to the checkpoint for (we have tried). It requires a root certificate installed on every machine. Because of the strict mode here (with no option to disable it), pub fails outright.

I have had the same issues with npm and even specific packages that several others implement to download things. (Like this issue here: sindresorhus/got#79)
The difference with Node/npm and others is that they all have ways to disable the strict certificate checking, like with the strict-ssl=false flag or the NODE_TLS_REJECT_UNAUTHORIZED environment variable.

@sethladd
Copy link
Contributor

@nex3 @whesse does the switch to BoringSSL make this issue easier to address for @alexpaluzzi ?

@alexpaluzzi
Copy link

@sethladd you are fast, I was in the middle of following up with an e-mail to you just now.

@nex3
Copy link
Member

nex3 commented Aug 28, 2015

My understanding is that BoringSSL has a non-global configuration mechanism, so hopefully it should address this.

@alexpaluzzi
Copy link

@sethladd @nex3 happy to hear that this isn't just dropped then. Thanks guys. Let me know if it's something I can help test or contribute to. I'm a member of the org here.

@whesse
Copy link
Contributor

whesse commented Aug 31, 2015

BoringSSL does let you add a certificate to the set of trusted certificates, and it would be possible to add a pub option or environment variable support that would add a certificate to the trusted set when running pub. That sounds like a great idea to me, that should be done soon.

To make this happen automatically instead would require making Dart us the OS's set of trusted certificates. Switching the global default set of certificates to be the set provided by the OS is a very large task, and the best first step would be an external tool (written in Dart, or in something else) to take the OS's set of trusted certificates (or just the added ones) and produce a single PEM file for a Dart program to import to its SecurityContext and trust.

@whesse whesse reopened this Aug 31, 2015
@alexpaluzzi
Copy link

Thanks @whesse.

Adding a certificate is good, but an option to disable the strict-ssl on pub get would be much better for us. I can simply tell an engineer or designer to flip a switch to update dependencies.

The same way I do now for npm and many others. (even curl with -k, wget, etc.) http://unix.stackexchange.com/questions/60750/does-curl-have-a-no-check-certificate-option-like-wget

This is all we are looking for. Everything but pub seems to have the option. I didn't think this would require changes to the SSL toolkit. I'm not sure what mechanism pub is even using to actually download things, but I suppose I should have started there.

In any case, I appreciate everyone's time and effort here. I promise there are many people in my case who will hit the same wall I'm at when they come to check out Dart.

@alexpaluzzi
Copy link

From what I can see, pub is using the http library from the SDK?

Looks like @sethladd suggested someone opened an issue on this a little over two years ago: http://stackoverflow.com/questions/16524659/bypass-certificate-error-using-http. I'm not sure one was ever made on it. If http had an option to ignore the errors and pub had a way to pass it through, that would work. Alternatively, http (or dart-io?) could look at some kind of environment variable and then you wouldn't have to do anything to pub.

@nex3
Copy link
Member

nex3 commented Aug 31, 2015

Marking this as blocked until BoringSSL APIs are available.

@nex3 nex3 added status-blocked Blocked from making progress by another (referenced) issue and removed closed-not-planned Closed as we don't intend to take action on the reported issue labels Aug 31, 2015
@lynxor
Copy link

lynxor commented Jul 15, 2016

Is there still no way to add a cert or disable strict ssl?

@whesse whesse removed the status-blocked Blocked from making progress by another (referenced) issue label Jul 15, 2016
@whesse
Copy link
Contributor

whesse commented Jul 15, 2016

Either of these could be implemented now. The BoringSSL APIs, which let you add a certificate to a security context, are available. We should decide which to do. Either one would be a change in Pub.
Because Mac is no longer using BoringSSL, I am not sure whether adding a certificate works on MacOS.
@zanderso

@zanderso
Copy link
Member

setTrustedCertificates{Bytes} can be called on SecurityContext.defaultContext to add more trusted certificates. It should work on all platforms.

@michaeldesu
Copy link

I'm brand new to dart, and in the same boat as alexpaluzzi (trialing dart in a corporate environment, and lucking out with pub get & https access due to network/security restrictions). I've been comparing coding and workflows between python & dart in my corp environment, and after some effort, I could finally get to work with python but not dart.

For package installation, dart needs a facility like:
pip install --trusted-host pypi.python.org
(after setting set https_proxy=http://xx:3128)

For https access, dart needs the ability to turn of verify, like
r = requests.post('https://xxx', data = {'key':'value'}, verify=False)
(where https_proxy= is not used) to avoid HandshakeException due to 'CERTIFICATE_VERIFY_FAILED'

..which allowed me to proceed (with python).

I would be interested to hear about @zanderso solution for setTrustedCertificates with say the http package.

Probably this situation is well known, and if so, I apologise. I'm just adding a small voice to this, since I've seen similar posts here about the same issue. For better corporate adoption, it's ideal that things like this get some attention, or please post a solution tutorial at dartlang site. Thanks alot.

@Kiongku
Copy link

Kiongku commented Sep 21, 2017

Same issue here, I am really surprised that this has not been dealt with after so long.
I am unable to move ahead with my trial of dart because of the inability to specify our root cert or disabling the cert checking all together for pub get.

If anyone has a solution, please post.

@zanderso
Copy link
Member

As a work-around, you should be able to edit the script that invokes the command line Dart VM on the pub snapshot to pass one of --root_certs_file or --root_certs_cache. This overrides SecurityContext.defaultContext. This script lives in dart-sdk/bin/pub.

@Kiongku
Copy link

Kiongku commented Sep 21, 2017

@zanderso thanks for the tip off, i was able to figure out the solution and it is working in windows finally.

Ref: changelog

For windows, I had the proxy self signed cert file saved as a BASE-64 encoded X.509 (.cer) file.
I added to my system environment variables the key "DART_VM_OPTIONS" with value "--root-certs-file=<path_to_cert>".
After doing this, pub script was able to connect to repo successfully.

I did not need to edit the pub script itself since after reading it, I realized it was expecting the options to come as an Env var named "DART_VM_OPTIONS", hence the changes above.

@Raydenn
Copy link

Raydenn commented Mar 6, 2018

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

@natebosch
Copy link
Member

Should be able to do DART_VM_OPTIONS="--root_certs_file=some_file" pub get. We don't have plans to manually mess with the SecurityContext in pub code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests