Thank you for your suggestions. I made one ridiculously stupid, amateurish mistake - I was specifying the key file and not the certificate in PostgreSQLDatabase.SSLCertificate. I was experimenting and one of the errors let me to believe that I needed to use the private key as it was “missing” when I initially tried to use the certificate. Honestly, I just don’t know enough about the intricacies of SSL certs and how they work in Xojo. Still, I should have known better.
Anyway, I specified the certificate like this and made sure to use the right SSL mode:
Var certFile As New FolderItem(“client-cert.pem”)
db.SSLMode = PostgreSQLDatabase.SSLRequire
Then I got this error: Connection Failed: certificate present, but not private key file "/Users/Aaron/.postgresql/postgresql.key"
So, I had to create a hidden folder (~/.postgresql/) that did not previously exist, copy the key file (client-key.pem) provided by Google Cloud into the newly created hidden folder and then rename the key file to postgresql.key. Finally, to restrict access to the key, I had to run the following terminal command:
chmod 0600 ~/.postgresql/postgresql.key
I was finally able to connect to my Google Cloud PostgreSQL instance via SSL.
If I gave you the complete picture and not just limited code snippets, you would have identified my errors. I sent you down the wrong path and for that I apologize.
This link was helpful as well: https://www.postgresql.org/docs/9.0/libpq-ssl.html