我最近将一个项目从 1.22.1 升级到 1.24.3。随后, pub get 失败了
客户端握手错误(操作系统错误:CERTIFICATE_VERIFY_FAILED:证书链中的自签名证书(ssl_cert.c:345))
或者
客户端握手错误(操作系统错误:错误:1000007d:SSL 例程:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED)
我发现了有关获取此错误的类似线程,但这些线程中给出的解决方案似乎都没有解决该问题。我在这些线程中运行了 pub --trace --verbosity all get as requests, output here
Webstorm 控制台的不太详细的输出是
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
Run Code Online (Sandbox Code Playgroud)
在我删除 appdata 中的 pub 缓存之前,建议的解决方案,在第一个或第二个包之后几乎立即遇到了同样的错误。
您使用的是 Windows 并使用卡巴斯基防病毒软件吗?我不知道所有的技术细节,但是这个防病毒软件会以某种方式影响握手。禁用它应该会有所帮助。
另一种解决方法是设置以下环境变量:
PUB_HOSTED_URL= https://pub.flutter-io.cn FLUTTER_STORAGE_BASE_URL= https://storage.flutter-io.cn
虽然我猜这不是 Dart SDK 问题,但这里也跟踪了该问题:https : //github.com/dart-lang/sdk/issues/32131
| 归档时间: |
|
| 查看次数: |
3359 次 |
| 最近记录: |