# \[Solved\] Mysql gitea (mariadb) SSL is not supported

**URL:** <https://forum.gitea.com/t/solved-mysql-gitea-mariadb-ssl-is-not-supported/7453>\
**Category:** Install/Maintain/Configure\
**Created:** [June 19, 2023, 11:22pm UTC](https://forum.gitea.com/t/solved-mysql-gitea-mariadb-ssl-is-not-supported/7453 "2023-06-19T23:22:55Z")\
**Posts on this page:** 6\
**Page:** 1

<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/solved-mysql-gitea-mariadb-ssl-is-not-supported/7453/1 "2023-06-19T23:22:55Z")

</div>

When setting up the mysql 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 the following error : `Error 1045 (28000): Access denied for user 'gitea'@'localhost'`.

I can sign to the user with `mysql -u gitea -p --ssl` just fine with the password I used. Also I tried different hostnames such as localhost:3306 and 127.0.0.1:3306

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [June 20, 2023, 2:31am UTC](https://forum.gitea.com/t/solved-mysql-gitea-mariadb-ssl-is-not-supported/7453/2 "2023-06-20T02:31:31Z")

</div>

Can you share your `[database]` config from app.ini? Also is your database hosted on separate server from Gitea?

---

<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 20, 2023, 11:25am UTC](https://forum.gitea.com/t/solved-mysql-gitea-mariadb-ssl-is-not-supported/7453/3 "2023-06-20T11:25:47Z")

</div>

```auto
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

[mysqld]
ssl-capath=/etc/mysql/certs/
ssl-cert = /etc/mysql/certs/server-cert.pem
ssl-key = /etc/mysql/certs/server-key.pem
tls-version = TLSv1.2,TLSv1.3

```

Note that /etc/mysql/certs/ contains server-cert.pem and server-key.pem which I generated following these steps :

1. Generate the SSL certificates using OpenSSL. This involves creating a private key and a certificate signing request (CSR). Here’s an example command to generate a private key and CSR: `openssl req -newkey rsa:2048 -nodes -keyout server-key.pem -out server-csr.pem`. This command generates a 2048-bit RSA private key and a CSR. You’ll be prompted to provide some information, such as the common name (CN) for the server.
2. Generate a self-signed server certificate using `server-key.pem` and `server-csr.pem`: `openssl x509 -req -in server-csr.pem -signkey server-key.pem -out server-cert.pem`
3. Store certificates in a certs folder : `sudo mkdir -p /etc/mysql/certs && mv server-key.pem server-cert.pem /etc/mysql/certs
4. Update permissions : `sudo chown -R mysql:mysql /etc/mysql/certs/ && sudo chmod 0600 /etc/mysql/certs/* `

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [June 22, 2023, 2:15pm UTC](https://forum.gitea.com/t/solved-mysql-gitea-mariadb-ssl-is-not-supported/7453/4 "2023-06-22T14:15:05Z")

</div>

Did you configure Gitea to use SSL when connecting to MySQL server? You will need to set `SSL_MODE` under `[database]` because it is disabled by default. See [Config Cheat Sheet](https://docs.gitea.com/administration/config-cheat-sheet#database-database).

---

<div class="post-metadata">

**Author:** ![usyinka](https://avatars.discourse-cdn.com/v4/letter/u/b38774/32.png) [@usyinka](https://forum.gitea.com/u/usyinka)\
**Post date:** [June 9, 2025, 8:51am UTC](https://forum.gitea.com/t/solved-mysql-gitea-mariadb-ssl-is-not-supported/7453/5 "2025-06-09T08:51:52Z")

</div>

I ran into the same issue with Gitea using MariaDB — SSL wasn’t supported by default. I fixed it by enabling SSL in the MariaDB server config and updating the Gitea app.ini to use ssl=true in the database section. Restarted both services, and it worked fine.

I hope it helps!

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [June 15, 2025, 12:53am UTC](https://forum.gitea.com/t/solved-mysql-gitea-mariadb-ssl-is-not-supported/7453/6 "2025-06-15T00:53:32Z")

</div>


