Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

expo build:ios, SSL verify failed #1436

Closed
ayakayakak opened this issue Jan 14, 2020 · 26 comments
Closed

expo build:ios, SSL verify failed #1436

ayakayakak opened this issue Jan 14, 2020 · 26 comments

Comments

@ayakayakak
Copy link

Description

I tried to build ios standalone app, but it failed with SSL_connect error.
Same error is reported here:
https://forums.expo.io/t/expo-build-ios-ssl-verify-failed/32102

Expected Behavior

I ran the command below.

expo build:ios -c

Checking if there is a build in progress...

Removed existing credentials from expo servers
Please enter your Apple Developer Program account credentials. These
credentials are needed to manage certificates, keys and provisioning profiles
in your Apple Developer account.
The password is only used to authenticate with Apple and never stored.
? Apple ID: xxxxxxxxxxx
? Password (for xxxxxxxxxxx): [hidden]

Observed Behavior

Trying to authenticate with Apple Developer Portal...
Authentication with Apple Developer Portal failed!
Reason: Unknown reason, raw: "SSL_connect returned=1 errno=0 state=error: certificate verify failed"
Error: Reason: Unknown reason, raw: "SSL_connect returned=1 errno=0 state=error: certificate verify failed"
    at runAction (/expo-cli@3.11.2/src/appleApi/fastlane.ts:28:17)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

Environment

expo diagnostics result:

Expo CLI 3.11.2 environment info:
    System:
      OS: macOS 10.15.2
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 8.13.0 - ~/.nodebrew/current/bin/node
      Yarn: 1.19.2 - /usr/local/bin/yarn
      npm: 6.13.1 - ~/.npm-global/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5522156
      Xcode: 11.2/11B52 - /usr/bin/xcodebuild
    npmPackages:
      @storybook/react-native: ^5.2.6 => 5.2.6 
      @types/expo: ^32.0.11 => 32.0.13 
      @types/react: ^16.8.14 => 16.9.11 
      @types/react-native: ^0.57.51 => 0.57.65 
      @types/react-navigation: ^3.4.0 => 3.4.0 
      expo: ^35.0.0 => 35.0.1 
      react: 16.8.3 => 16.8.3 
      react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8 
      react-navigation: 3.0.9 => 3.0.9 
@oreno4649
Copy link

I have same problem.

My environment is here.

Environment

expo diagnostics

  Expo CLI 3.11.5 environment info:
    System:
      OS: macOS 10.15.2
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 10.13.0 - ~/.nodenv/versions/10.13.0/bin/node
      Yarn: 1.21.1 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nodenv/versions/10.13.0/bin/npm
    IDEs:
      Android Studio: 3.5 AI-191.8026.42.35.5900203
      Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
    npmPackages:
      @storybook/react-native: ^5.2.6 => 5.2.6 
      @types/expo: ^32.0.11 => 32.0.13 
      @types/react: ^16.8.14 => 16.9.11 
      @types/react-native: ^0.57.51 => 0.57.65 
      @types/react-navigation: ^3.4.0 => 3.4.0 
      expo: ^35.0.0 => 35.0.1 
      react: 16.8.3 => 16.8.3 
      react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8 
      react-navigation: 3.0.9 => 3.0.9 

@jason-xie-123
Copy link

jason-xie-123 commented Jan 14, 2020

the same for me

image

@quinlanj
Copy link
Member

The problem is that the ca cert we bundle with our version of ruby within expo-cli is expired. we havent pushed out an official fix yet, but here's a hack you can do to unblock yourself:

 # go into the `node_modules` of your expo-cli
cd `npm root -g`/expo-cli/node_modules/@expo/traveling-fastlane-darwin/traveling-fastlane-1.10.0-osx/lib/ruby/lib

# verify that the ca-bundle.crt is actually expired
openssl x509 -enddate -noout -in ca-bundle.crt

# directory of your openssl cert_file
cert_file="$( openssl version -d | awk -F'"' '{print $2}' )/cert.pem"

# backup expired crt
cp ca-bundle.crt ca-bundle.crt.bak

# copy your openssl cert file
cp $cert_file ca-bundle.crt

lmk if that works for anyone!

@oreno4649
Copy link

@quinlanj Thank you! It is work!
The following path is used because yarn is used.

 # go into the `node_modules` of your expo-cli
cd ~/.config/yarn/global/node_modules/@expo/traveling-fastlane-darwin/traveling-fastlane-1.11.3-osx/lib/ruby/lib

@anbackmynt
Copy link

same problem for me

@ayakayakak
Copy link
Author

@quinlanj
It works for me too! Thank you!!!

@birdca
Copy link

birdca commented Jan 14, 2020

@quinlanj
Not working for me, the steps:

$ cd `npm root -g`/expo-cli/node_modules/@expo/traveling-fastlane-darwin/traveling-fastlane-1.11.3-osx/lib/ruby/lib
$ openssl x509 -enddate -noout -in ca-bundle.crt
$ cert_file="$( openssl version -d | awk -F'"' '{print $2}' )/cert.pem"
$ cp ca-bundle.crt ca-bundle.crt.bak
$ cp $cert_file ca-bundle.crt

# cd to the working directory
$ expo-cli upload:ios
Downloading build from ...
Downloading [=============================================================================================================================================================] 100% 0.0
Resolving the ITC team ID...
Available session is not valid any more. Continuing with normal login.
Failed to upload the standalone app to the app store.
SSL_connect returned=1 errno=0 state=error: certificate verify failed
$ expo-cli diagnostics

  Expo CLI 3.11.5 environment info:
    System:
      OS: macOS High Sierra 10.13.6
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
      npm: 6.13.4 - ~/.nvm/versions/node/v10.16.3/bin/npm
    IDEs:
      Android Studio: 3.5 AI-191.8026.42.35.5977832
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^36.0.0 => 36.0.1 
      react: 16.9.0 => 16.9.0 
      react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4 
      react-navigation: ^4.0.10 => 4.0.10 
    npmGlobalPackages:
      expo-cli: 3.11.5

@ubaidjs
Copy link

ubaidjs commented Jan 14, 2020

@quinlanj After the solution is pushed, do we have to undo the fix you shared, if yes, then how?

@doug-sheridan
Copy link

The problem is that the ca cert we bundle with our version of ruby within expo-cli is expired. we havent pushed out an official fix yet, but here's a hack you can do to unblock yourself:

 # go into the `node_modules` of your expo-cli
cd `npm root -g`/expo-cli/node_modules/@expo/traveling-fastlane-darwin/traveling-fastlane-1.10.0-osx/lib/ruby/lib

# verify that the ca-bundle.crt is actually expired
openssl x509 -enddate -noout -in ca-bundle.crt

# directory of your openssl cert_file
cert_file="$( openssl version -d | awk -F'"' '{print $2}' )/cert.pem"

# backup expired crt
cp ca-bundle.crt ca-bundle.crt.bak

# copy your openssl cert file
cp $cert_file ca-bundle.crt

lmk if that works for anyone!

This did not work for me. Still getting the error:
connect ECONNREFUSED 127.0.0.1:19001

@quinlanj Thank you! It is work!
The following path is used because yarn is used.

 # go into the `node_modules` of your expo-cli
cd ~/.config/yarn/global/node_modules/@expo/traveling-fastlane-darwin/traveling-fastlane-1.11.3-osx/lib/ruby/lib

This also didn't work for me as I'm not using yarn for expo-cli.

Please help! This is a critical bug that is preventing me from submitting updates to my client facing apps!

@brentvatne
Copy link
Member

brentvatne commented Jan 14, 2020

we're working on fixing this now. status page: https://status.expo.io/incidents/vw27kb523vn7?u=mgkr96ykcctd

please refer to @quinlanj's workaround in #1436 (comment) as a temporary fix.

i'll lock the thread for now to make sure this comment is surfaced, we'll post updates when they are available.

@quinlanj
Copy link
Member

Solution

We've pushed a fix, please get it by running:

# should give you 3.11.7 or higher
 npm install -g expo-cli

Rolling back

If you applied the hack and wanted to revert it, please run the following:

# go into the `node_modules` of your expo-cli
 cd `npm root -g`/expo-cli/node_modules/@expo/traveling-fastlane-darwin/traveling-fastlane-1.10.0-osx/lib/ruby/lib

# remove the unexpired cert
 rm ca-bundle.crt

# put the expired cert back. You can verify the rollback was successful if your expo-cli can no longer make https requests again
 mv ca-bundle.crt.bak ca-bundle.crt

@expo expo unlocked this conversation Jan 15, 2020
@RazaShehryar
Copy link

@quinlanj Even after updating expo-cli, I am still getting the error.

Authentication with Apple Developer Portal failed!
Reason: Unknown reason, raw: "Could not receive latest API key from App Store Connect, this might be a server issue."

@hardeepbrah
Copy link

A temporary fix is to change the date of the system back a few days. I changed it to 11 Jan 2020 and it worked fine.

@RazaShehryar
Copy link

A temporary fix is to change the date of the system back a few days. I changed it to 11 Jan 2020 and it worked fine.

Still no effect. I am getting the same error as mentioned above.

@hardeepbrah
Copy link

A temporary fix is to change the date of the system back a few days. I changed it to 11 Jan 2020 and it worked fine.

Still no effect. I am getting the same error as mentioned above.

Try to change it back to 10 or more days back. I used it on a Centos 7 machine

@hardeepbrah
Copy link

A temporary fix is to change the date of the system back a few days. I changed it to 11 Jan 2020 and it worked fine.

Still no effect. I am getting the same error as mentioned above.

This error message is different I suppose. I was getting "Could not verify certificate"

@marabesi
Copy link

marabesi commented Jan 15, 2020

Jus to give an update on that, I updated the expo-cli to 3.11.7 and everything went as expected. Here goes my system info:

  Expo CLI 3.11.7 environment info:
    System:
      OS: Linux 5.0 elementary OS 5.1 Hera
      Shell: 5.4.2 - /usr/bin/zsh
    Binaries:
      Node: 10.17.0 - ~/.nvm/versions/node/v10.17.0/bin/node
      Yarn: 1.21.1 - /usr/bin/yarn
      npm: 6.11.3 - ~/.nvm/versions/node/v10.17.0/bin/npm
    npmPackages:
      @types/expo: ^31.0.9 => 31.0.13 
      @types/react: ^16.8.23 => 16.9.5 
      @types/react-native: ^0.57.65 => 0.57.65 
      expo: ^35.0.1 => 35.0.1 
      react: 16.8.3 => 16.8.3 
      react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8 
    npmGlobalPackages:
      expo-cli: 3.11.7

@RazaShehryar
Copy link

RazaShehryar commented Jan 15, 2020 via email

@anbackmynt
Copy link

anbackmynt commented Jan 15, 2020 via email

@brentvatne
Copy link
Member

thanks for letting us know that the issue has been resolved for you!

@yoheinishikubo
Copy link

I found an issue like this occurs on the server when expo client:ios is executed.

@duhaime
Copy link

duhaime commented Feb 16, 2020

I saw the error reported above on expo-cli version 3.13.1 because I had just renewed my app store developer credentials minutes before running the command.

It took about 20 minutes for expo build:ios to succeed, possibly because my credential status took some time to update on Apple's side?

@dangkhoa2708
Copy link

my expo is 36.0.0 and use expo-cli 3.13.1. I experienced this and also tried solutions above, but not help. Any update on this ?

@dhuebes
Copy link

dhuebes commented Apr 15, 2020

@dangkhoa2708 facing the same here.
Until yesterday was working fine.

@brentvatne
Copy link
Member

hello! please use the latest version of expo-cli.

if you still encounter the problem with the latest version then create a new issue and follow the template, thanks!

@expo expo locked as resolved and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

17 participants