Open AnestisSi opened 1 year 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.
Something that may assist with this. You may need to set .env variables manually in the .env file.
These environment variables are located in the following lines from the config/database.php file.
'options' => (env('DB_SSL')) ? ((env('DB_SSL_IS_PAAS')) ? [
PDO::MYSQL_ATTR_SSL_CA => env('DB_SSL_CA_PATH'), // /path/to/ca.pem
] : [
PDO::MYSQL_ATTR_SSL_KEY => env('DB_SSL_KEY_PATH'), // /path/to/key.pem
PDO::MYSQL_ATTR_SSL_CERT => env('DB_SSL_CERT_PATH'), // /path/to/cert.pem
PDO::MYSQL_ATTR_SSL_CA => env('DB_SSL_CA_PATH'), // /path/to/ca.pem
PDO::MYSQL_ATTR_SSL_CIPHER => env('DB_SSL_CIPHER'),
]) : [],
],
Try updating your .env file in the database configuration with the following and see? Note. You may need to make necessary changes to your configuration that reflect configuration needed for your database platform.
DB_SSL=True DB_SSL_IS_PAAS=True DB_SSL_CA_PATH='/path/to/ca.pem' DB_SSL_KEY_PATH='/path/to/key.pem' DB_SSL_CERT_PATH='/path/to/cert.pem' DB_SSL_CIPHER='Cipher Name'
Hope this helps!
Hi, did this configuration for the application help solve your issue?
I ran into a similar problem with Azure's MySQL Flexible servers.
When I enabled the DB_SSL_IS_PAAS=True
option I was getting a different error:
SQLSTATE[HY000] [2002] (SQL: select * from information_schema.tables where table_schema = snipeit and table_name = migrations and table_type = 'BASE TABLE')
The actual issue was only present in the full laravel log (/var/www/html/storage/logs/laravel.log
):
Peer certificate CN=`abcdef123456.database.azure.com' did not match expected CN=`snipeit.snipeit.private.mysql.database.azure.com'
This was because I was trying to connect to the private DNS zone entry as above.
If you hit a similar error make sure you're using the public DNS name, like snipeit.mysql.database.azure.com
Debug mode
Describe the bug
Hello,
I have an Azure MySQL database configured to enforce TLS1.2(require_secure_transport). When that option is on the application cannot connect. If I turn it off snipe-it connects successfully. Is snipe-it not using ssl to connect to mysql? Or do I need to add specific options on the .env in order to do it?
Reproduction steps
Expected behavior
Allow secure connections to MySQL
Screenshots
No response
Snipe-IT Version
v6.0.10
Operating System
Linux
Web Server
not sure using docker
PHP Version
7.4.26
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
Additional context
Is this a fresh install or an upgrade? fresh install
What OS and web server you're running Snipe-IT on
What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) docker
Include what you've done so far in the installation, and if you got any error messages along the way. normal installation. Run into a small issue with the url of the install because Azure was using proxy which I resolved. And only the Database issue
Indicate whether or not you've manually edited any data directly in the database no
Add any other context about the problem here.