# Failed to login to balena

**URL:** <https://forums.balena.io/t/failed-to-login-to-balena/26578>\
**Category:** openBalena\
**Created:** [August 21, 2019, 10:30pm UTC](https://forums.balena.io/t/failed-to-login-to-balena/26578 "2019-08-21T22:30:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pli](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@pli](https://forums.balena.io/u/pli)\
**Post date:** [August 21, 2019, 10:30pm UTC](https://forums.balena.io/t/failed-to-login-to-balena/26578/1 "2019-08-21T22:30:38Z")

</div>

Hi,

I installed openbalena on an aws instance and got this error at login.

| |\_\_ \_\_ \_ | | \_\_\_\_ \_ \_\_ \_\_ \_  
| '\_ \ / _` || | / __ \| '_ \ / _` |  
| |_) | (_) || || /| | | || () |  
|.\_/ \ __,_||_| \__ /|| || \__,\_|

Logging in to [x.y.z.com](http://x.y.z.com)  
? How would you like to login? Credentials  
? Email:   
? Password: [hidden]  
FetchError: request to [https://api.x.y.z.com/login\_](https://api.x.y.z.com/login_) failed, reason: self signed certificate in certificate chain  
at ClientRequest. (/snapshot/versioned-source/node\_modules/node-fetch/index.js:133:11)  
at ClientRequest.emit (events.js:189:13)  
at ClientRequest.EventEmitter.emit (domain.js:441:20)  
at TLSSocket.socketErrorListener (\_http\_client.js:392:9)  
at TLSSocket.emit (events.js:189:13)  
at TLSSocket.EventEmitter.emit (domain.js:441:20)  
at emitErrorNT (internal/streams/destroy.js:82:8)  
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)  
at process.\_tickCallback (internal/process/next\_tick.js:63:19)

I am running on CentOS 7 and I already updated the system to trust the self signed cert by using the following commands and restarted the docker:

> export NODE\_EXTRA\_CA\_CERTS=~/open-balena/config/certs/root/ca.crt  
> update-ca-trust force-enable  
> cp /root/open-balena/config/certs/root/ca.crt /etc/pki/ca-trust/source/anchors/  
> update-ca-trust extract

Any idea?  
Thanks

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [August 21, 2019, 10:48pm UTC](https://forums.balena.io/t/failed-to-login-to-balena/26578/4 "2019-08-21T22:48:51Z")

</div>

Hey @pli

I’m assuming you’re using the `quickstart` script to get up and running.  
As you’re using a custom domain name, I wonder if this was specified when you ran `quickstart` and if the certificates generated were copied to your client after that?

---

<div class="post-metadata">

**Author:** ![pli](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@pli](https://forums.balena.io/u/pli)\
**Post date:** [August 21, 2019, 11:05pm UTC](https://forums.balena.io/t/failed-to-login-to-balena/26578/6 "2019-08-21T23:05:59Z")

</div>

Hi @chrisys,

I used a registered domain name but self signed cert for testing at this moment. Yes, I am using quickstart to setup the instance.

Thanks

---

<div class="post-metadata">

**Author:** ![afitzek](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/afitzek/32/359_2.png) [@afitzek](https://forums.balena.io/u/afitzek)\
**Post date:** [August 22, 2019, 7:37am UTC](https://forums.balena.io/t/failed-to-login-to-balena/26578/7 "2019-08-22T07:37:07Z")

</div>

Hi @pli,  
Can you show us the CLI command you run on your workstation? You mentioned you use the command `export NODE_EXTRA_CA_CERTS=~/open-balena/config/certs/root/ca.crt` and restarted docker. I’m not sure what you mean by that, but you need to add the envvar `NODE_EXTRA_CA_CERTS` to point to the `ca.crt` for the cli process.  
Also to get to the bottom of this, maybe you can check what certificate is used for your api: `curl -v https://api.x.y.z.com/login_`.

---

<div class="post-metadata">

**Author:** ![pli](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@pli](https://forums.balena.io/u/pli)\
**Post date:** [August 23, 2019, 4:58pm UTC](https://forums.balena.io/t/failed-to-login-to-balena/26578/10 "2019-08-23T16:58:47Z")

</div>

@afitzek

I found out my problem is caused by the DNS pointing to the wrong server running openbalena. Thanks for your help!

Patrick
