Hi, I have problem with connecting Symfony app with PlanetScale. This is the error I am getting:
An exception occurred in the driver: SQLSTATE[HY000] [1105] unknown error: Code: UNAVAILABLE
server does not allow insecure connections, client must use SSL/TLS
This is my DATABASE_URL suggested by PlanetScale:
DATABASE_URL='mysql://57d19a8h5xauk6bbn3s3:************@aws.connect.psdb.cloud:3306/xnonxix?serverVersion=8.0'
I also tried with following options (i’m not sure is this valid way to add options to db url?):
DATABASE_URL='mysql://57d19a8h5xauk6bbn3s3:************@aws.connect.psdb.cloud:3306/xnonxix?serverVersion=8.0&ssl={"rejectUnauthorized":false}&sslaccept=strict'
And this:
DATABASE_URL='mysql://57d19a8h5xauk6bbn3s3:************@aws.connect.psdb.cloud:3306/xnonxix?serverVersion=8.0&ssl={"rejectUnauthorized":false}&sslcert=/etc/ssl/certs/ca-certificates.crt'
Unfortunately, nothing works.
If this can help there is my fly.toml:
app = "xnonxix"
primary_region = "lhr"
[build]
[build.args]
NODE_VERSION = "20"
PHP_VERSION = "8.2"
SYMFONY_APP_ENV = "prod"
[env]
SYMFONY_APP_ENV = "prod"
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]
[deploy]
command = "bin/console doctrine:migrations:migrate --no-interaction"
Does anyone know what solve a problem? I’m not sure is the problem in my server setup, Symfony or PlanetScale?