MySQL | Node.js: self-signed certificate in certificate chain

luisanHOBBY

a year ago

project id:
42952ebf-512e-4da5-8a59-ab7e240624cf

I'm migrating my MySQL db to railway. Connection works fine as long as I don't require SSL, otherwise I get the self-signed certificate error.

From reading another answer, I've attempted to download and provide the certificates locally using echo | openssl s_client -showcerts -connect [roundhouse.proxy.rlwy.net:24296](roundhouse.proxy.rlwy.net:24296) > full_output.txt, (i've removed the certificate filter on this command to see the results) and get the following

```CONNECTED(00000005)

no peer certificate available

No client certificate CA names sent

SSL handshake has read 5 bytes and written 327 bytes
Verification: OK```

My environment holds both the server and the db. Am I expected to connect through the private network to my db? I'm relatively new to backend and db so I can tell I'm missing some important context

0 Replies

a year ago

if I remember correctly, the mysql database offered by railway does not come with certificates


luisanHOBBY

a year ago

Are certificates unusable on mysql dbs? Or can I bring my own, if they're not providing any?

"We currently do not support external SSL certificates since we provision one for you."


a year ago

that's true for postgres, but not for mysql


a year ago

you could provide a mysql image that comes with certificates, but for mysql it's not natively provided


a year ago

though having a certificate would not matter as long as you connect to the database exclusively over the private network, it's private for a reason!


luisanHOBBY

a year ago

Huh. That does makes sense, now doesn't it. Let me try it


luisanHOBBY

a year ago

projects running locally will not be able to access the private network, correct? So i'll have to disable ssl when working locally


a year ago

correct


luisanHOBBY

a year ago

worked like a charm. that's pretty cool.


luisanHOBBY

a year ago

I'm worried about running stuff locally, however. I connect to my production db locally sometimes. Won't it be exposed to man-in-the-middle attacks in that case?


a year ago

you could not connection to your production database publicly, instead have another railway environment running a development database.
if you need to manage the production database, do that through dbgate


a year ago

thats what i do, the app on railway connects to the database privately, and the database itself has the tcp proxy removed, thus cutting off public access.
then database is managed with dbgate deployed into the same project.

1221141124530307000


luisanHOBBY

a year ago

sorry, i'm not sure I understand how to connect locally to the dbGate app, or how to connect the dbGate app to my db on the same project


a year ago

open the domain it generates


luisanHOBBY

a year ago

oh damn!


a year ago

username and password are in the service variables


luisanHOBBY

a year ago

sorry yeah, i got excited and started playing around


a year ago

haha railway is pretty exciting


luisanHOBBY

a year ago

pretty cool that you made that template


luisanHOBBY

a year ago

thanks so much man! finally done with this migration 🙌


a year ago

awesome!


a year ago

I like templates 🙂


MySQL | Node.js: self-signed certificate in certificate chain - Railway Help Station