expo build:ios, SSL verify failed

Hi every one.

I try build with ios, but it is failed.

$ EXPO_DEBUG=true expo build:ios                                                                                                                                                                             
Checking if there is a build in progress...                                                                                                                                                                                                   

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: xxxxxxxx@xxxxxxxx
? Password (for ryo_s@ichigen.me): [hidden]                                                                                                                                                                                                   
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.5/src/appleApi/fastlane.ts:28:17)
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
    at Object.authenticate (/expo-cli@3.11.5/src/appleApi/authenticate.ts:46:40)
    at IOSBuilder.getAppleCtx (/expo-cli@3.11.5/src/commands/build/ios/IOSBuilder.js:47:23)
    at IOSBuilder.produceMissingCredentials (/expo-cli@3.11.5/src/commands/build/ios/IOSBuilder.js:123:22)
    at IOSBuilder.prepareCredentials (/expo-cli@3.11.5/src/commands/build/ios/IOSBuilder.js:65:7)
    at IOSBuilder.run (/expo-cli@3.11.5/src/commands/build/ios/IOSBuilder.js:19:7)
    at IOSBuilder.command (/expo-cli@3.11.5/src/commands/build/BaseBuilder.js:55:7)
    at Command.<anonymous> (/expo-cli@3.11.5/src/exp.ts:81:7)

When such SSL handshake fails, what i shoud do?

expo diagnotcs result:

  Expo CLI 3.11.5 environment info:
    System:
      OS: macOS High Sierra 10.13.6
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.3.1 - /usr/local/bin/node
      Yarn: 1.16.0 - /usr/local/bin/yarn
      npm: 6.12.0 - /usr/local/bin/npm
    IDEs:
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^36.0.0 => 36.0.2 
      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: ^3.11.0 => 3.11.0 
    npmGlobalPackages:
      expo-cli: 3.11.5
4 Likes

Hi,

Iā€™m having a similar issue, in my case I can run the build command, but when I run the expo upload:ios Iā€™m getting the following error:

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
Error: SSL_connect returned=1 errno=0 state=error: certificate verify failed
at runFastlaneAsync (/expo-cli@3.11.5/src/commands/upload/utils.ts:79:11)
at process._tickCallback (internal/process/next_tick.js:68:7)

My expo diagnostics:

Expo CLI 3.11.5 environment info:
System:
OS: macOS 10.14.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.3 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
IDEs:
Xcode: 11.3/11C29 - /usr/bin/xcodebuild
npmPackages:
expo: ^36.0.0 => 36.0.2
react: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4
react-navigation: ^4.0.10 => 4.0.10
npmGlobalPackages:
expo-cli: 3.11.5

1 Like

Same error for me with expo build:ios

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.5/src/appleApi/fastlane.ts:28:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Object.authenticate (/expo-cli@3.11.5/src/appleApi/authenticate.ts
:46:40)
    at IOSBuilder.getAppleCtx (/expo-cli@3.11.5/src/commands/build/ios/IO
SBuilder.js:47:23)
    at IOSBuilder.produceMissingCredentials (/expo-cli@3.11.5/src/command
s/build/ios/IOSBuilder.js:123:22)
    at IOSBuilder.prepareCredentials (/expo-cli@3.11.5/src/commands/build
/ios/IOSBuilder.js:65:7)
    at IOSBuilder.run (/expo-cli@3.11.5/src/commands/build/ios/IOSBuilder
.js:19:7)
    at IOSBuilder.command (/expo-cli@3.11.5/src/commands/build/BaseBuilde
r.js:55:7)
    at Command.<ano
$ expo diagnostics

  Expo CLI 3.11.5 environment info:
    System:
      OS: macOS 10.15.2
      Shell: 3.0.2 - /usr/local/bin/fish
    Binaries:
      Node: 13.3.0 - /usr/local/bin/node
      Yarn: 1.21.1 - /usr/local/bin/yarn
      npm: 6.13.2 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Xcode: 11.3/11C29 - /usr/bin/xcodebuild
    npmPackages:
      @types/react: ^16.8.23 => 16.9.13
      @types/react-native: ^0.57.65 => 0.57.65
      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
.0.tar.gz => 0.61.4
      react-navigation: ^4.0.10 => 4.0.10

Hi,
I am also facing the same issue today with expo build:ios. Is there any solution available?

Error: Reason: Unknown reason, raw: ā€œSSL_connect returned=1 errno=0 state=error: certificate verify failedā€
at runAction (/expo-cli@3.11.5/src/appleApi/fastlane.ts:28:17)
at process._tickCallback (internal/process/next_tick.js:68:7)

Expo CLI 3.11.5 environment info:
System:
OS: macOS High Sierra 10.13.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.14.1 - ~/.nvm/versions/node/v10.14.1/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.14.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
expo: ^36.0.0 => 36.0.0
react: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4
react-navigation: ^3.11.0 => 3.13.0
npmGlobalPackages:
expo-cli: 3.11.5

Same also having this issue today was working fine for past couple of months

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.2.3/src/commands/build/ios/appleApi/fastlane.js:24:17)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Object.authenticate (/expo-cli@3.2.3/src/commands/build/ios/appleApi/authenticate.js:15:40)
at IOSBuilder.getAppleCtx (/expo-cli@3.2.3/src/commands/build/ios/IOSBuilder.js:47:24)
at IOSBuilder.produceMissingCredentials (/expo-cli@3.2.3/src/commands/build/ios/IOSBuilder.js:123:22)
at IOSBuilder.prepareCredentials (/expo-cli@3.2.3/src/commands/build/ios/IOSBuilder.js:66:7)
at IOSBuilder.run (/expo-cli@3.2.3/src/commands/build/ios/IOSBuilder.js:19:7)
at IOSBuilder.command (/expo-cli@3.2.3/src/commands/build/BaseBuilder.js:54:7)
at Command. (/expo-cli@3.2.3/src/exp.ts:81:7)

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!

edit: yarn version here

7 Likes

It seems that exactly after this incident, even expo push notifications stop working. Is it also related ?

@securelogic This should be decoupled from push notifications. Could you post your problem in a separate thread with repro steps? thanks!

Yes this works for build and i am not getting this error any more.

directory of your openssl cert_file

cert_file=ā€œ$( openssl version -d | awk -Fā€™ā€ā€™ ā€˜{print $2}ā€™ )/cert.pem"

I dont have the cert.pem file , How to generate or where to find it?

Thanks

This worked for me. Only note is that the part of the path that says traveling-fastlane-1.10.0-osx may vary depending on the operational system.

Thanks for the workaround! :+1:

It is just a bunch of PEM encoded CA certs. One way to get such a list is to use mk-ca-bundle.

If you install curl (e.g. via Homebrew) then it should also come with mk-ca-bundle.pl.

e.g. I have it in /usr/local/Cellar/curl/7.67.0/libexec/mk-ca-bundle.pl

I you just run it with no arguments it should download certdata.txt from Mozilla and convert it into ca-bundle.crt which is the file you want.

@quinlanj
The workaround did let me run expo:build:os, but now the app wonā€™t make http requests on the simulator. I assume thatā€™s related to the workaround? Hereā€™s the error I got:

Error: Request failed with status code 400
    at createError (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/expo-cli/node_modules/axios/lib/adapters/http.js:237:11)
    at IncomingMessage.emit (events.js:208:15)
    at endReadableNT (_stream_readable.js:1154:12)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

I have the same issue, but I get cd: no such file or directory: usr/local/lib/node_modules/expo-cli when following the commands

And why did this bug suddenly started happening this morning?

Iā€™m facing this issue as well. It looks like Expo opened an issue tracker here: Expo Status - Unable to run expo build:ios

Thanks @quinlanj for the fast responses!

1 Like

Thank you so much

1 Like

hi all! Weā€™ve pushed a fix, please get it by running:

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

Hello to everyone,

i canā€™t do expo build: ios from my app yesterday. I get an SSL certificate validation error. my expo-cli version is up-to-date. Previously I published about 1 year ago on expo again, Iā€™m updating my application from time to time I did not have a problem with build. What is the solution by expo? I donā€™t understand why it happened like this :frowning:

Tanks!
My SSL errors were improved.
expo-cli ver: 3.11.7