# Mysql with TLS/SSL

**URL:** <https://forum.gitea.com/t/mysql-with-tls-ssl/2304>\
**Category:** Install/Maintain/Configure\
**Created:** [July 6, 2020, 12:17am UTC](https://forum.gitea.com/t/mysql-with-tls-ssl/2304 "2020-07-06T00:17:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fission](https://avatars.discourse-cdn.com/v4/letter/f/c5a1d2/32.png) [@fission](https://forum.gitea.com/u/fission)\
**Post date:** [July 6, 2020, 12:17am UTC](https://forum.gitea.com/t/mysql-with-tls-ssl/2304/1 "2020-07-06T00:17:16Z")

</div>

Keep getting a `The database settings are invalid: Error 1045: Access without SSL denied` when trying to set up using mysql with self signed TLS/SSL.

I’ve tried setting **SSL\_MODE** to _skip-verify_ and _true_ per the docs but continue to get this error. It almost seems like this setting is being ignored as I have other applications connecting to the DB via SSL with no issues and even connecting with `mysql --ssl -h mariadb.lan -u gitea -p` works successfully.

I’ve tested with both the binary and the official docker image on centos7 and get the same thing either way.

Am I missing something or has anyone else managed to configure this successfully?

database portion of app.ini

```auto
[database]
DB_TYPE = mysql
HOST = mariadb.lan:3306
NAME = gitea
USER = gitea
PASSWD = passwd
SSL_MODE = skip-verify
CHARSET = utf8mb4
LOG_SQL = true

```

---

<div class="post-metadata">

**Author:** ![Linuk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/linuk/32/3801_2.png) [@Linuk](https://forum.gitea.com/u/Linuk)\
**Post date:** [June 19, 2023, 11:22pm UTC](https://forum.gitea.com/t/mysql-with-tls-ssl/2304/2 "2023-06-19T23:22:03Z")

</div>

I have the same problem here. When setting up the database like this it works fine :

```auto
SET old_passwords=0;

CREATE USER 'gitea'@'localhost' IDENTIFIED BY 'PASSWORD......';

CREATE DATABASE giteadb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';

GRANT ALL PRIVILEGES ON giteadb.* TO 'gitea'@'localhost' with grant option;

FLUSH PRIVILEGES;

EXIT;

```

but if I require ssl like this :

`CREATE USER 'gitea'@'localhost' IDENTIFIED BY 'PASSWORD......' require ssl;` I get Error 1045 when installing for the first time.
