解決pod install报错:unable to access: LibreSSL SSL_read: error:Operation timed out, errno 60

简介: 解決pod install报错:unable to access: LibreSSL SSL_read: error:Operation timed out, errno 60

出现场景

新电脑运行一个老Flutter项目,flutter run运行ios出现以下报错。

Launching lib/main.dart on iPhone in debug mode...
Upgrading AppFrameworkInfo.plist
Upgrading Podfile
Updating project for Xcode compatibility.
Upgrading project.pbxproj
Upgrading Runner.xcscheme
Upgrading Info.plist
Removing script build phase dependency analysis.
Automatically signing iOS for device deployment using specified development team in Xcode project: YE6STNG83Y
Running pod install...
CocoaPods' output:
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      - Flutter
      - device_info
      - flutter_compass
      - flutter_reactive_ble
      - fluttertoast
      - location_permissions
      - shared_preferences

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `device_info` from `.symlinks/plugins/device_info/ios`
    -> Fetching podspec for `flutter_compass` from `.symlinks/plugins/flutter_compass/ios`
    -> Fetching podspec for `flutter_reactive_ble` from `.symlinks/plugins/flutter_reactive_ble/ios`
    -> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
    -> Fetching podspec for `location_permissions` from `.symlinks/plugins/location_permissions/ios`
    -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_e_c_d.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/e/c/d/Protobuf/3.23.1/Protobuf.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_4_a_9.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/4/a/9/SwiftProtobuf/1.21.0/SwiftProtobuf.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path downloaded: all_pods_versions_5_1_0.txt, save ETag: W/"647d3427-442"
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.0/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.0/Toast.podspec.json
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.1/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.1/Toast.podspec.json
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.2/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.2/Toast.podspec.json
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.3/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.3/Toast.podspec.json
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.4/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.4/Toast.podspec.json
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/3.0/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/3.0/Toast.podspec.json
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/3.1.0/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/3.1.0/Toast.podspec.json
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/4.0.0/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/4.0.0/Toast.podspec.json
      CDN: trunk Relative path downloaded: Specs/5/1/0/Toast/3.0/Toast.podspec.json, save ETag: W/"1e0-MsWSKav89BhQFiuDu5JZ3IQ3JHM"
      CDN: trunk Relative path downloaded: Specs/5/1/0/Toast/2.0/Toast.podspec.json, save ETag: W/"1e1-XMAmeOSWaQhWFkqknINNBeT7MU8"
      CDN: trunk Relative path downloaded: Specs/5/1/0/Toast/4.0.0/Toast.podspec.json, save ETag: W/"207-kbOWxW7nKleQgW9A06lN01erwZY"
      CDN: trunk Relative path downloaded: Specs/5/1/0/Toast/2.4/Toast.podspec.json, save ETag: W/"1e0-B3O4/A6XNSymBUUXvsfr3UEQAp0"
      CDN: trunk Relative path downloaded: Specs/5/1/0/Toast/2.2/Toast.podspec.json, save ETag: W/"1e1-0iSflVSJlWXJ5b3RwLwOStN29ZI"
      CDN: trunk Relative path downloaded: Specs/5/1/0/Toast/2.3/Toast.podspec.json, save ETag: W/"1e0-T5NYYMAtVHrj9RTZ/AbCWriM+Fg"
      CDN: trunk Relative path downloaded: Specs/5/1/0/Toast/2.1/Toast.podspec.json, save ETag: W/"1e1-KkXNE+hQimz2mT48zU8twidPLos"
      CDN: trunk Relative path downloaded: Specs/5/1/0/Toast/3.1.0/Toast.podspec.json, save ETag: W/"1e4-FKk2htbIv+Jyev00JBTjVmCoofM"
      CDN: trunk Relative path: Specs/5/1/0/Toast/4.0.0/Toast.podspec.json modified during this run! Returning local
      CDN: trunk Relative path: Specs/e/c/d/Protobuf/3.14.0/Protobuf.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/4/a/9/SwiftProtobuf/1.15.0/SwiftProtobuf.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/5/1/0/Toast/4.0.0/Toast.podspec.json modified during this run! Returning local

    Comparing resolved specification to the sandbox manifest
      A Flutter
      A Protobuf
      A SwiftProtobuf
      A Toast
      A device_info
      A flutter_compass
      A flutter_reactive_ble
      A fluttertoast
      A location_permissions
      A shared_preferences

    Downloading dependencies

    -> Installing Flutter (1.0.0)

    -> Installing Protobuf (3.14.0)
     > Git download
     > Git download
         $ /usr/bin/git clone https://github.com/protocolbuffers/protobuf.git /var/folders/1y/x4fgnssn2y97hys92bsdyw2w0000gn/T/d20230605-5720-hackl6 --template= --single-branch --depth 1 --branch v3.14.0

    [!] Error installing Protobuf
    [!] /usr/bin/git clone https://github.com/protocolbuffers/protobuf.git /var/folders/1y/x4fgnssn2y97hys92bsdyw2w0000gn/T/d20230605-5720-hackl6 --template= --single-branch --depth 1 --branch v3.14.0

    Cloning into '/var/folders/1y/x4fgnssn2y97hys92bsdyw2w0000gn/T/d20230605-5720-hackl6'...
    fatal: unable to access 'https://github.com/protocolbuffers/protobuf.git/': LibreSSL SSL_read: error:02FFF03C:system library:func(4095):Operation timed out, errno 60

    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader.rb:144:in `rescue in execute_command'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader.rb:141:in `execute_command'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-downloader-1.6.3/lib/cocoapods-downloader/base.rb:175:in `block in executable'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-downloader-1.6.3/lib/cocoapods-downloader/git.rb:107:in `block in clone'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader.rb:175:in `block in ui_sub_action'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader.rb:174:in `ui_sub_action'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-downloader-1.6.3/lib/cocoapods-downloader/git.rb:105:in `clone'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-downloader-1.6.3/lib/cocoapods-downloader/git.rb:73:in `download!'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-downloader-1.6.3/lib/cocoapods-downloader/base.rb:83:in `block in download'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader.rb:159:in `block in ui_action'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader.rb:158:in `ui_action'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-downloader-1.6.3/lib/cocoapods-downloader/base.rb:81:in `download'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader.rb:110:in `download_source'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader.rb:77:in `download_request'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader/cache.rb:256:in `download'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader/cache.rb:239:in `block in uncached_pod'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader/cache.rb:266:in `in_tmpdir'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader/cache.rb:238:in `uncached_pod'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/downloader.rb:42:in `download'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/pod_source_downloader.rb:69:in `download!'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/pod_source_installer.rb:117:in `download_source'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/pod_source_installer.rb:67:in `install!'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:621:in `install_source_of_pod'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:539:in `block (2 levels) in install_pod_sources'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:86:in `titled_section'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:538:in `block in install_pod_sources'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:535:in `each'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:535:in `install_pod_sources'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:258:in `block in download_dependencies'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:257:in `download_dependencies'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:163:in `install!'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/command/install.rb:52:in `run'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in `run'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-1.12.1/bin/pod:55:in `<top (required)>'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/bin/pod:23:in `load'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/bin/pod:23:in `<main>'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/bin/ruby_executable_hooks:22:in `eval'
    /Users/surecall/.rvm/rubies/ruby-3.0.0/bin/ruby_executable_hooks:22:in `<main>'

Error output from CocoaPods:
         Cloning into '/var/folders/1y/x4fgnssn2y97hys92bsdyw2w0000gn/T/d20230605-5720-hackl6'...
         fatal: unable to access 'https://github.com/protocolbuffers/protobuf.git/': LibreSSL SSL_read: error:02FFF03C:system library:func(4095):Operation timed out, errno 60

    [!] Automatically assigning platform `iOS` with version `11.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Exception: Error running pod install

解决方案

根据错误提示,是因为pod安装protocolbuf的依赖时,下载超时导致的,所以我们只需要能确保我们的网络能正常下载github的库就行。

fatal: unable to access 'https://github.com/protocolbuffers/protobuf.git/': LibreSSL SSL_read: error:02FFF03C:system library:func(4095):Operation timed out, errno 60

配置命令行代理

将以下配置复制到环境变量中(我的是~/.zshrc),最后的端口口改成自己软件的代理端口。

alias proxy="
    export https_proxy=http://127.0.0.1:7890;
    export http_proxy=http://127.0.0.1:7890;
    export all_proxy=socks5://127.0.0.1:7890;"

   # export http_proxy=socks5://127.0.0.1:7890;
   # export https_proxy=socks5://127.0.0.1:7890;
   # export all_proxy=socks5://127.0.0.1:7890;
   # export no_proxy=socks5://127.0.0.1:7890;
   # export HTTP_PROXY=socks5://127.0.0.1:7890;
   # export HTTPS_PROXY=socks5://127.0.0.1:7890;
   # export ALL_PROXY=socks5://127.0.0.1:7890;
   # export NO_PROXY=socks5://127.0.0.1:7890;"
alias unproxy="
    unset http_proxy;
    unset https_proxy;
    unset all_proxy;
    unset no_proxy;
    unset HTTP_PROXY;
    unset HTTPS_PROXY;
    unset ALL_PROXY;
    unset NO_PROXY"


保存文件,使用source ~/.zshrc使配置生效。

重新运行flutter run,很快pod install就成功了。

aaa@aaadeMacBook-Air horizon % flutter run 
Launching lib/main.dart on iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: ED93LDE843P
Running pod install...                                             10.6s
Running Xcode build...                                                  
Xcode build done.                                           12.3s


相关实践学习
Serverless极速搭建Hexo博客
本场景介绍如何使用阿里云函数计算服务命令行工具快速搭建一个Hexo博客。
相关文章
|
5月前
|
人工智能 网络安全 开发工具
视觉智能开放平台操作报错合集之服务部署在pdd的服务器,调用报错:The SSL connection could not be established,该如何解决
在使用视觉智能开放平台时,可能会遇到各种错误和问题。虽然具体的错误代码和消息会因平台而异,但以下是一些常见错误类型及其可能的原因和解决策略的概述,包括但不限于:1. 认证错误、2. 请求参数错误、3. 资源超限、4. 图像质量问题、5. 服务不可用、6. 模型不支持的场景、7. 网络连接问题,这有助于快速定位和解决问题。
135 0
|
1月前
|
数据采集 网络安全 Python
Python使用urllib或者urllib2模块打开网页遇到ssl报错
Python使用urllib或者urllib2模块打开网页遇到ssl报错
|
3月前
|
网络安全 图形学 Android开发
Unity与安卓丨AS报错:SSL peer shut down incorrectly
Unity与安卓丨AS报错:SSL peer shut down incorrectly
Unity与安卓丨AS报错:SSL peer shut down incorrectly
|
3月前
|
算法 Java 测试技术
java 访问ingress https报错javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version
java 访问ingress https报错javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version
|
3月前
|
安全 前端开发 网络安全
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
137 0
|
4月前
|
安全 前端开发 网络安全
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER(上海蓝云阻断页)
在Azure App Service上部署的应用遇到`SSL: WRONG_VERSION_NUMBER`错误。问题可能由不兼容的TLS版本引起,但即使将最小入站TLS版本改为1.2,问题仍存在。实际原因是上海蓝云的阻断页面,表明网站未完成ICP备案或有安全规定限制。解决方案包括:1) 对App Service绑定自定义域名并进行ICP备案,或2) 使用Application Gateway处理公网请求。在复杂环境中,需仔细排查和适配规则。
164 11
|
3月前
|
Android开发
解决Android、Flutter编译时Gradle报错:javax.net.ssl.SSLException: Connection reset
解决Android、Flutter编译时Gradle报错:javax.net.ssl.SSLException: Connection reset
357 0
|
6月前
LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
112 0
|
6月前
|
Linux 网络安全 Python
解决方案:Centos7运行Django项目报错no module named _ssl
解决方案:Centos7运行Django项目报错no module named _ssl
170 0
|
6月前
|
关系型数据库 网络安全 对象存储
Flink报错问题之Flink报错java.io.EOFException: SSL peer shut down incorrectly如何解决
Flink报错通常是指在使用Apache Flink进行实时数据处理时遇到的错误和异常情况;本合集致力于收集Flink运行中的报错信息和解决策略,以便开发者及时排查和修复问题,优化Flink作业的稳定性。