2

I'm trying to connect to heroku via CLI (using heroku's Toolbelt) and I'm unable to do so. When I type my credentials, heroku replies with:

Post https://api.heroku.com/login: x509: certificate signed by unknown authority

I'm inside a company's firewall that blocks most connections, and I have to use a certificate to navigate.

What can I do to login to heroku via cli?

2 Answers2

1

I was also facing this issue because of my organization's firewall. Solution is to simply download and install the organization's certs.

  1. Once you have your organization's specific ".cer" file then convert that file to ".pem" using

    openssl x509 -inform der -in orgCertFile.cer -out certificate.pem
    
  2. Next, set following variable either as system variable or temp variable in current command line

    export SSL_CERT_FILE=orgCertFile.cer
    export NODE_EXTRA_CA_CERTS=certificate.pem
    
  3. Finally try logging in using heroku command

    heroku login
    
Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Mayur Gite
  • 11
  • 1
0

you need to set your proxy and then issue the heroku login command

Source : https://devcenter.heroku.com/articles/using-the-cli#using-an-http-proxy

Using an HTTP proxy If you’re behind a firewall that requires use of a proxy to connect with external HTTP/HTTPS services, you can set the HTTP_PROXY or HTTPS_PROXY environment variables in your local developer environment, before running the heroku command. For example, on a Unix system you could do something like this:

$ export HTTP_PROXY=http://proxy.server.com:portnumber 
or 
$ export HTTPS_PROXY=https://proxy.server.com:portnumber 
$ heroku login

On a Windows machine, either set it in the System Properties/Environment Variables, or do it from the terminal:

>  set HTTP_PROXY=http://proxy.server.com:portnumber 
or    
>  set HTTPS_PROXY=https://proxy.server.com:portnumber    
>  heroku login