Reputation: 304
Trying to develop and deploy to Firebase Hosting but getting the following error message when I run firebase init from PowerShell:
Server Error. unable to get local issuer certificate
Does anybody know about this? Here's the log file contents:
[debug] [2017-06-09T10:45:14.977Z] ----------------------------------------------------------------------
[debug] [2017-06-09T10:45:14.979Z] Command: C:\nodejs\node.exe C:\nodejs\node_modules\firebase-tools\bin\firebase init
[debug] [2017-06-09T10:45:14.979Z] CLI Version: 3.9.1
[debug] [2017-06-09T10:45:14.980Z] Platform: win32
[debug] [2017-06-09T10:45:14.980Z] Node Version: v7.9.0
[debug] [2017-06-09T10:45:14.980Z] Time: Fri Jun 09 2017 11:45:14 GMT+0100 (GMT Daylight Time)
[debug] [2017-06-09T10:45:14.980Z] ----------------------------------------------------------------------
[debug]
[debug] [2017-06-09T10:45:14.993Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
[debug] [2017-06-09T10:45:14.993Z] > authorizing via signed-in user
[info]
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
U:\firebase
[info]
=== Project Setup
[info]
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add,
[info] but for now we'll just set up a default project.
[info]
[debug] [2017-06-09T10:45:29.107Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects
Fri Jun 09 2017 11:45:29 GMT+0100 (GMT Daylight Time)
[debug] [2017-06-09T10:45:29.692Z] Error: unable to get local issuer certificate
[error]
[error] Error: Server Error. unable to get local issuer certificate
Many thanks
Upvotes: 2
Views: 2955
Reputation: 61
I finally managed to solve this same exact problem. Simply set the following environtment variable:
set NODE_TLS_REJECT_UNAUTHORIZED=0
and the firebase project should initialize correctly. However, I believe that this solution is more similar to a hack rather than to a solution.
Upvotes: 4
Reputation: 165
Use this certificate root:
https://curl.haxx.se/ca/cacert.pem
Copy this certificate bundle on your disk. And use this on php.ini:
curl.cainfo = "path_to_cert\cacert.pem"
remember to do
php --ini
This will tell you exactly which php.ini file is being loaded, so you know which one to modify, also, don't forget to restart server.
ALSO:
If this doesn´t work for you, two more solutions:
this guide with another certificate
this master.zip file with another pem
Remember ==> curl.cainfo = "C:/somewhere/cacert.pem"
Hope this solves your problem!
Upvotes: 1