snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.03k stars 3.18k forks source link

Snipe-IT and MariaDB won't connect with SSL. #15729

Open erbtwelsh opened 1 day ago

erbtwelsh commented 1 day ago

Debug mode

Describe the bug

Brand new Rocky Linux 9.4 server, deployed snipeit.

Trying to get snipeit to connect to our mariadb server with SSL, it won't connect. D'oh! Looks like we can't connect to your database. Please update your database settings in your .env file. Your database says: SQLSTATE[HY000] [2002] Cannot connect to MySQL using SSL (Connection: mysql, SQL: select 2 + 2)

But if I change DB_SSL=false, I can connect with no issues.

I an connect with SSL using mysql -u -p --ssl-ca=/etc/pki/ca-trust/source/anchors/ca_cert.pem

Reproduction steps

  1. DB_SSL=true
  2. Inital setup won't work

Expected behavior

It connect to MariaDB using SSL.

Screenshots

image

Snipe-IT Version

Latest GIT version did

Operating System

Rocky Linux 9.4

Web Server

Apache

PHP Version

8.3

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

welcome[bot] commented 1 day ago

πŸ‘‹ Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

snipe commented 1 day ago

Can you show me your REQUIRED: DATABASE SETTINGS and OPTIONAL: SSL DATABASE SETTINGS from your env (minus the password, of course.)

erbtwelsh commented 1 day ago

--------------------------------------------

REQUIRED: DATABASE SETTINGS

--------------------------------------------

DB_CONNECTION=mysql DB_HOST=sql02.fakedomain.com DB_PORT=3306 DB_DATABASE=snipeit (Shortened) DB_USERNAME=InventoryUser (Shortened) DB_PASSWORD=redacted (Obviously changed) DB_PREFIX=null DB_DUMP_PATH='/usr/bin' DB_CHARSET=utf8mb4 DB_COLLATION=utf8mb4_unicode_ci DB_SANITIZE_BY_DEFAULT=true

--------------------------------------------

OPTIONAL: SSL DATABASE SETTINGS

--------------------------------------------

DB_SSL=true DB_SSL_IS_PAAS=false DB_SSL_KEY_PATH=null DB_SSL_CERT_PATH=null DB_SSL_CA_PATH='/var/www/snipeit/CERTSVR-CA.pem' DB_SSL_CIPHER=null DB_SSL_VERIFY_SERVER=true