search

Home  >  Q&A  >  body text

PlanetScaleDb Prisma Configuration - Server does not allow insecure connections, clients must use SSL/TLS

I'm starting a new PlanetScale support project and using a Prisma setup. I followed the instructions on this official documentation (except changing the database name) and after proxying locally to the database I found myself unable to run the npx prisma db Push command with the following error:

server does not allow insecure connections, client must use SSL/TLS

I am very new to database setup and before this I never knew I needed to configure any of these connections as I thought they were handled as part of the database setup I was using.

I know that mySql that I use through Prisma requires SSL or TLS before performing any interaction with the database, but I haven't found any way to set this up for my environment.

I've seen references to adding ?tls={true} to the end of my DATABASE_URL but that does nothing. Additionally, given that the DATABASE_URL provided is

provided by PlanetScale
DATABASE_URL='mysql://un5pbmobnc73muwvbo77:************@us-east.connect.psdb.cloud/*******?ssl={"rejectUnauthorized":true}'

I tried changing {"rejectUnauthorized":true} to {"rejectUnauthorized":false}. This doesn't change anything. A more complex solution involving objects was causing my database to not find the parameters at all.

I know SSL is deprecated and I shouldn't be using it, but not only do I not know how to properly add TLS to my mySQL, but as you may have already determined, I find myself somewhat unable to fully grasp it Implementation concept.

P粉039633152P粉039633152433 days ago855

reply all(1)I'll reply

  • P粉163951336

    P粉1639513362023-11-03 00:17:47

    Replace ?ssl={"rejectUnauthorized":true} with ?sslaccept=strict. Below is an example.

    DATABASE_URL="mysql://xxxx:yyyy@ap-northeast.connect.psdb.cloud/zzzz?sslaccept=strict"

    Details are written below.

    https://www.prisma.io/docs/concepts/database connector/mysql#arguments

    Good luck!

    reply
    0
  • Cancelreply