0

I am going through the exact same process as the answered question found here (Connect a Google CloudSQL Postgres database to Data Studio), but I am not as advanced a user as most. I am encountering a similar problem to what was mentioned in the above question, and then some:

  1. I have created a client certificate and downloaded the client-cert.pem, client-key.pem and the server-ca.pem files to my local machine.
  2. I received the same error when attempting to link Data Studio to our Google Cloud SQL Postgres Database as a data source. " Can't reach the host. Please double check your connection parameters. Learn more about database connectors here. "

  3. I tried running the following command " openssl pkcs8 -topk8 -inform PEM -outform DER -in client-key.pem -out client-key.pkcs8 -nocrypt " to change the format of the client key in our Cloud Shell Project, but I received this error " pkcs8: Cannot open input file client-key.pem, No such file or directory ".

I would assume that I should not be running this command from the Cloud Shell Project terminal then. Would anybody know where I should be running this command instead? I can provide any extra material if needed. Thank you in advance - much appreciated.

Shane
  • 3
  • 4

1 Answers1

0

It sounds like the file doesn't exist location where you are running the command. Did you upload the client-key.pem into Cloud Shell?

kurtisvg
  • 3,412
  • 1
  • 8
  • 24
  • Hi kurtisvg, thank you for taking an interest here. Yes, I uploaded the client-key.pem file into our main Storage Bucket. However, when I run this command " **openssl pkcs8 -topk8 -inform PEM -outform PEM -in client-key.pem -out client-key.key -nocrypt** " I still get the same error stating that there is no such file or directory. Perhaps there is a way to point the terminal to the storage bucket I am using? – Shane Oct 16 '19 at 04:19
  • Cloud Shell is a linux environment, so you need to upload the file into it to be able to use it with commands. From the shell, you can click the 3 dots menu and use "Upload file" to upload it into your working directory. – kurtisvg Oct 16 '19 at 15:56
  • Thank you kurtisvg, I uploaded the relevant files using the 3 dots menu you mentioned. I proceeded to download the formatted client-key.key file after running the command and selected that when uploading the configuration files when configuring the data studio data source. I am now receiving a different error notification: "**Can't reach the host. Please double check your connection parameters. Learn more about database connectors here**". I have double checked the details several times now and these exact details are being used in our of our other applications so they are correct. Any ideas? – Shane Oct 17 '19 at 08:35
  • The command in your question is `openssl pkcs8 -topk8 -inform PEM -outform DER -in client-key.pem -out client-key.pkcs8 -nocrypt`. The question you linked to mentioned that this was the incorrect command, and they had to use `openssl pkcs8 -topk8 -inform PEM -outform PEM -in client-key.pem -out client-key.key -nocrypt` instead. Can you try the second command and see what that gets you? – kurtisvg Oct 17 '19 at 16:33
  • Hi Kurtisvg, thank you for your ongoing assistance here. I managed to come right, one of the Google Cloud Support Personnel responded to my contact request. There was something they needed to reset on their side. Appreciate your help, wishing you a pleasant day further – Shane Oct 18 '19 at 13:50