# Ratel UI not connecting to Alpha using TLS

**URL:** <https://discuss.dgraph.io/t/ratel-ui-not-connecting-to-alpha-using-tls/11079>\
**Category:** Ratel\
**Tags:** kind:question\
**Created:** [October 22, 2020, 2:49pm UTC](https://discuss.dgraph.io/t/ratel-ui-not-connecting-to-alpha-using-tls/11079 "2020-10-22T14:49:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggilmartin](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@ggilmartin](https://discuss.dgraph.io/u/ggilmartin)\
**Post date:** [October 22, 2020, 2:49pm UTC](https://discuss.dgraph.io/t/ratel-ui-not-connecting-to-alpha-using-tls/11079/1 "2020-10-22T14:49:01Z")

</div>

Hi guys,

I’m trying to run Dgraph in a docker network (Alpha, Zero and Ratel)  
The network spins up fine and everything looks good until I try and connect to the Alpha via Ratel.

I followed this page [https://dgraph.io/docs/deploy/tls-configuration/](https://dgraph.io/docs/deploy/tls-configuration/) but can’t get the connection to work with TLS.  
My Alpha docker container is telling me no TLS cert was provided

> TLS handshake error from X.X.X.X: remote error: tls: unknown certificate

and also

> TLS handshake error from X.X.X.X: tls: client didn’t provide a certificate

I have the generated .p12 cert in my Mac keychain as per the above documentation, but nothing seems to work.

Any help would be much appreciated

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [October 22, 2020, 6:09pm UTC](https://discuss.dgraph.io/t/ratel-ui-not-connecting-to-alpha-using-tls/11079/3 "2020-10-22T18:09:11Z")

</div>

Can you share the actual steps/commands used?

---

<div class="post-metadata">

**Author:** ![joaquin](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/joaquin/32/2619_2.png) [@joaquin](https://discuss.dgraph.io/u/joaquin)\
**Post date:** [October 23, 2020, 12:45am UTC](https://discuss.dgraph.io/t/ratel-ui-not-connecting-to-alpha-using-tls/11079/4 "2020-10-23T00:45:27Z")

</div>

As you are using keychain, I will deduce using Chrome for this. And as you are using the .p12 cert, I assume you want to use Mutual TLS, where the Alpha authenticates the client (Chrome) using the client cert/key in .p12 format?

Can you get this to work without Mutual Authentication, just TLS without client authentication? Then after we can verify Mutual Authentication works.

How is alpha configured (commandline and any applicable DGRAPH\_ALPHA env vars if they were used)? Did you create the certificate using localhost as the server name? What does the output of **`dgraph cert ls`**?

---

<div class="post-metadata">

**Author:** ![ggilmartin](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@ggilmartin](https://discuss.dgraph.io/u/ggilmartin)\
**Post date:** [October 27, 2020, 10:07am UTC](https://discuss.dgraph.io/t/ratel-ui-not-connecting-to-alpha-using-tls/11079/5 "2020-10-27T10:07:07Z")

</div>

Sure!  
Here’s the docker-compose file I’m using

> version: ‘3.6’
> 
> services:
> 
> zero:  
> image: dgraph/dgraph:latest  
> container\_name: test\_dgraph\_zero  
> ports:  
> - 5080:5080  
> - 6080:6080  
> restart: on-failure  
> command: dgraph zero --my=zero:5080
> 
> alpha:  
> image: dgraph/dgraph:latest  
> container\_name: test\_dgraph\_alpha  
> ports:  
> - 8082:8080  
> - 9080:9080  
> restart: on-failure  
> command:  
> - bash  
> - “-c”  
> - |  
> dgraph cert --dir /tls -n ‘localhost’  
> dgraph cert --dir /tls -c ‘testing’  
> chmod a+r /tls/client.testing.key  
> dgraph alpha --tls\_dir /tls --whitelist=0.0.0.0/0 --tls\_client\_auth REQUIREANDVERIFY --zero=zero:5080
> 
> ratel:  
> image: dgraph/dgraph:latest  
> container\_name: test\_dgraph\_ratel  
> ports:  
> - 8100:8000  
> command: dgraph-ratel

After I run this, the network spins up and I can connect to the Ratel UI on my browser, but cannot connect to the Alpha.  
I can make the connection to the Alpha when TLS is off.

---

<div class="post-metadata">

**Author:** ![ggilmartin](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@ggilmartin](https://discuss.dgraph.io/u/ggilmartin)\
**Post date:** [October 27, 2020, 1:48pm UTC](https://discuss.dgraph.io/t/ratel-ui-not-connecting-to-alpha-using-tls/11079/6 "2020-10-27T13:48:46Z")

</div>

That’s right, I’m using Chrome and want the browser to authenticate using the client cert/key. (I’ve also tried in Firefox with no success either)

The Alpha is setup in a docker-compose file as follows

> alpha:  
> image: dgraph/dgraph:latest  
> container\_name: test\_dgraph\_alpha  
> ports:  
> - 8082:8080  
> - 9080:9080  
> restart: on-failure  
> command:  
> - bash  
> - “-c”  
> - |  
> dgraph cert --dir /tls -n ‘localhost’  
> dgraph cert --dir /tls -c ‘testing’  
> chmod a+r /tls/client.testing.key  
> dgraph alpha --tls\_dir /tls --whitelist=0.0.0.0/0 --tls\_client\_auth --zero=zero:5080

Yes, localhost was used as the server name.
