couldn't connect to INSTANCE : x509: certificate has expired or is not yet valid

1,500 views
Skip to first unread message

Mirror Mirage0

unread,
Mar 10, 2018, 1:03:16 PM3/10/18
to Google Cloud SQL discuss
Hi, I have been struggling with this error for past several hours. Any help would be appreciated.

Running on Lubuntu VM.
gcloud is installed, authenticated, lists the project, gives description of database. starts listening

q@q-VirtualBox:~/Desktop/q$ ./cloud_sql_proxy -instances="q:a:q2"=tcp:3306
2018/03/10 07:05:20 Listening on 127.0.0.1:3306 for q:a:q2
2018/03/10 07:05:20 Ready for new connections
2018/03/10 07:05:30 New connection for "q:a:q2"
2018/03/10 07:05:37 couldn't connect to "q:a:q2": x509: certificate has expired or is not yet valid

Please help

Dinesh (Google Platform Support)

unread,
Mar 10, 2018, 5:02:43 PM3/10/18
to google-cloud...@googlegroups.com
Hello,

It seems your SSL certificate is invalid. You may want to view expiration date of your SSL certificate (both server and client) under SSL configuration by Getting information about your server certificate.  You can create a new certificate if server certificate expires by following the same documentation. You should refresh your server certificate before it expires to ensure that your clients can connect to the instance securely.

Similarly, you can manage your client certificate as described in the same documentation.  

I hope it helps?

Regards,

Mirror Mirage0

unread,
Mar 11, 2018, 1:41:00 AM3/11/18
to Google Cloud SQL discuss
Hi,

I tried both.
1) Refreshed Server Certificate. Server certificate shows expiration date of 2020 , which is ample time.
2) Generated New Client Certificate. (I don't use the client 

Still gives me the same error x509 : certificate has expired or is not valid.
I am using Ubuntu Linux VM. I can connect to the database using mysql client, since I have whitelisted my IP.
Is there any other info which you need to troubleshoot this? Some kind of log file?

Thanks for your help

Dinesh (Google Platform Support)

unread,
Mar 11, 2018, 3:34:53 PM3/11/18
to Google Cloud SQL discuss
Can you please check date and time for your host machine is not out of sync? Please configure NTP for your host machine to get the clock in sync. If this does not resolve the issue, I will recommend to raising this issue on Google public issue tracker platform[1] which is meant for customer issues, bugs and feature request tracking purpose. Group platform is meant for general product discussions.


[1]: https://issuetracker.google.com

Mirror Mirage0

unread,
Mar 12, 2018, 12:05:40 AM3/12/18
to Google Cloud SQL discuss
Hi,

Date and Time is in sync. NTP is up and running 

      Local time: س 2018-03-10 10:47:13 +04
  Universal time: س 2018-03-10 06:47:13 UTC
        RTC time: س 2018-03-10 06:46:18
       Time zone: Asia/Dubai (+04, +0400)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

I will report a bug in the link you provided.
Reply all
Reply to author
Forward
0 new messages