Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 08S01 (1043) -> Bad Handshake. MySQL Connection with SSL certs #16886

Closed
Xaohs opened this issue Dec 18, 2022 · 13 comments · Fixed by prisma/prisma-engines#3727
Closed
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. team/schema Issue for team Schema. topic: mysql topic: mysql 8 topic: ssl
Milestone

Comments

@Xaohs
Copy link

Xaohs commented Dec 18, 2022

Bug description

Hi, I've been trying to set up SSL for my prisma connection but I'm getting a "Bad Handshake" error, even though on MySQL Workbench, tableplus... my connection works fine with certificates.
I've followed the guide on the prisma docs website here. And placed both client-identity.p12 and rootca.cert inside my ./prisma folder.
The connection string i'm using is:
'mysql://user:password@ip:port/database?sslidentity=client-identity.p12&sslpassword=mypassword&sslcert=rootca.cart'

Prisma information

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

Environment & setup

Trying to connect to: MySQL Server V8.0.31 @ Ubuntu 22.04

Prisma Version

prisma                  : 4.7.1
@prisma/client          : 4.7.1
@Xaohs Xaohs added the kind/bug A reported bug. label Dec 18, 2022
@Druue Druue added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. topic: ssl team/schema Issue for team Schema. topic: mysql labels Dec 19, 2022
@Jolg42 Jolg42 added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. topic: mysql 8 and removed bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. labels Dec 21, 2022
@Jolg42
Copy link
Member

Jolg42 commented Dec 22, 2022

This looks like the same issue as #14903

I tried to get a reproduction of this error, but so far could not.

One person reported the following workaround

  • pin MySQL Server to v8.0.29

@Jolg42 Jolg42 added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Dec 22, 2022
@Jolg42
Copy link
Member

Jolg42 commented Dec 22, 2022

I did not reproduce with certificates but based on #14903 I think it's related - further investigation and discussion there.

@shangzhipan
Copy link

@janpio Might be related to #14903 as well.

@Marcdj-02
Copy link

+1; Experiencing the same. Seems to be related to SQL v0.8.30.

@kapilvats
Copy link

I have encountered the same problem while using a MySQL database hosted on Azure. Is there any solution?

@Marcdj-02
Copy link

I have encountered the same problem while using a MySQL database hosted on Azure. Is there any solution?

Reverting to an older version of SQL. (For azure managed plan this means creating an new database on v5.7) or configuring SSL properly?

@GuillaumeSarfati
Copy link

Same probleme here on Azure the database was in v 8.029 until this morning 9am when they upgrade it to 8.031 and now I am not able to connect anymore in production... the prisma team could watch this ?

@chris-simmons-9
Copy link

Anybody have any kind of workaround for this yet?

Microsoft automatically upgraded our mysql servers from 8.0.28 to 8.0.31 overnight and this took out all of our environments (including production).

@Marcdj-02
Copy link

Anybody have any kind of workaround for this yet?

Microsoft automatically upgraded our mysql servers from 8.0.28 to 8.0.31 overnight and this took out all of our environments (including production).

Reverting to an older version of SQL. (For azure managed plan this means creating an new database on v5.7)

@AnimeAllstar
Copy link

AnimeAllstar commented Feb 20, 2023

Any news on the patch for this besides downgrading to MySQL v5.7? My azure production environment just crashed due to Azure updating their MySQL server version. I can't connect to my azure MySQL server using prisma due to having to use sslaccept=strict.

@janpio
Copy link
Member

janpio commented Feb 24, 2023

This should now be fixed in our dev version which you can install via npm install prisma@dev @prisma/client@dev. Regenerate your Prisma Client and try again - and it should work. Woudl be very helpful if some of you could confirm this is indeed working now. Thanks!

@AnimeAllstar
Copy link

@janpio Works with Azure Database for MySQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. team/schema Issue for team Schema. topic: mysql topic: mysql 8 topic: ssl
Projects
None yet
Development

Successfully merging a pull request may close this issue.