# Using External Database with sslmode=required

**URL:** <https://forum.rasa.com/t/using-external-database-with-sslmode-required/45825>\
**Category:** \[Deprecated\] Rasa X Community Edition\
**Created:** [July 16, 2021, 1:45pm UTC](https://forum.rasa.com/t/using-external-database-with-sslmode-required/45825 "2021-07-16T13:45:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![renata](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@renata](https://forum.rasa.com/u/renata)\
**Post date:** [July 16, 2021, 1:45pm UTC](https://forum.rasa.com/t/using-external-database-with-sslmode-required/45825/1 "2021-07-16T13:45:17Z")

</div>

Hello there, I am fairly new to Rasa and I am trying to install Rasa X using the Helm charts on Kubernetes. I would like to connect Rasa X to an external postgres database and this external db requires using the sslmode=required flag.

I couldn’t find the possibility to set it in the values.yml file.

Unfortunately without it, the db-migration-service fails with the following error:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: password authentication failed for user “mybot” FATAL: no pg\_hba.conf entry for host “ip.address.here”, user “mybot”, database “mydb”, SSL off

Any help is appreciated 🙂

Thank you!

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [July 16, 2021, 5:37pm UTC](https://forum.rasa.com/t/using-external-database-with-sslmode-required/45825/2 "2021-07-16T17:37:27Z")

</div>

> [@renata](#):
>
> psycopg2

@renata I not work much on Rasa X and Kubernetes. But try install `pip install psycopg2` in your environment, hope it will help. I using Docker to run the Rasa Open Source and its containers have different ip.address inside container, so please inspect the pods.

---

<div class="post-metadata">

**Author:** ![renata](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@renata](https://forum.rasa.com/u/renata)\
**Post date:** [July 26, 2021, 12:10pm UTC](https://forum.rasa.com/t/using-external-database-with-sslmode-required/45825/3 "2021-07-26T12:10:03Z")

</div>

Maybe it helps somebody else… I managed to set up the connection to the external PostgreSQL database for both Rasa X and the tracker store using SSL by…

**adding the whole connection string (including the query param sslmode=required) as the additional env variable DB\_URL**

```
rasax:
    extraEnvs: 
    - name: DB_URL
      valueFrom:
        secretKeyRef:
            name: "rasa-x-pg-secret"
            key: "dbUrl"
dbMigrationService:
    extraEnvs: 
    - name: DB_URL
      valueFrom:
        secretKeyRef:
            name: "rasa-x-pg-secret"
            key: "dbUrl"
eventService:
    extraEnvs: 
    - name: DB_URL
      valueFrom:
        secretKeyRef:
            name: "rasa-x-pg-secret"
            key: "dbUrl"

```

**and modifying the ConfigMap holding the rasa-configuration-files:**

```
tracker_store:
  type: sql
  dialect: "postgresql"
  url: db_host
  port: 12345
  username: username
  password: sqlpassword
  db: rasa
  login_db: rasa
  query:
    sslmode: require
```

---

<div class="post-metadata">

**Author:** ![renata](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@renata](https://forum.rasa.com/u/renata)\
**Post date:** [July 26, 2021, 12:12pm UTC](https://forum.rasa.com/t/using-external-database-with-sslmode-required/45825/4 "2021-07-26T12:12:59Z")

</div>

Thanks for the tip… At the end I managed to set the configs right…

---

<div class="post-metadata">

**Author:** ![webdev-rohit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/webdev-rohit/32/18943_2.png) [@webdev-rohit](https://forum.rasa.com/u/webdev-rohit)\
**Post date:** [July 7, 2022, 1:07pm UTC](https://forum.rasa.com/t/using-external-database-with-sslmode-required/45825/5 "2022-07-07T13:07:47Z")

</div>

How did you manage to define the path for your ssl certificate used by your postgresql instance in your tracker store configuration?
