Skip to content

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

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

Closed
DartBot opened this issue May 21, 2014 · 20 comments
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented May 21, 2014

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.

@anders-sandholm
Copy link
Contributor

Added Area-Pub, Triaged labels.

@nex3
Copy link
Member

nex3 commented May 23, 2014

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


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

@andersjohnsen
Copy link

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 May 27, 2014

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>

@sgjesse
Copy link
Contributor

sgjesse commented May 28, 2014

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 May 30, 2014

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

@sgjesse
Copy link
Contributor

sgjesse commented Jul 3, 2014

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.

@sgjesse
Copy link
Contributor

sgjesse commented Jul 3, 2014

Issue #17664 has been merged into this issue.

1 similar comment
@sgjesse
Copy link
Contributor

sgjesse commented Jul 3, 2014

Issue #17664 has been merged into this issue.

@nex3
Copy link
Member

nex3 commented Jul 7, 2014

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 Jul 7, 2014

This comment was originally written by [email protected]


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

@nex3
Copy link
Member

nex3 commented Jul 7, 2014

@DartBot
Copy link
Author

DartBot commented Jul 31, 2014

This comment was originally written 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.

@nex3
Copy link
Member

nex3 commented Jul 31, 2014

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.

@sgjesse
Copy link
Contributor

sgjesse commented Aug 12, 2014

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.

@sgjesse
Copy link
Contributor

sgjesse commented Aug 12, 2014

Issue #20270 has been merged into this issue.

@nex3
Copy link
Member

nex3 commented Aug 12, 2014

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?

@sgjesse
Copy link
Contributor

sgjesse commented Aug 27, 2014

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.

@nex3
Copy link
Member

nex3 commented Aug 27, 2014

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).

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/pub#983.

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants