How to connect Google Apps Script JDBC to Amazon RDS using SSL

Google has launched support for SSL connections in the JDBC service. Google has added three new connection options to support this feature: _serverSslCertificate , _clientSslCertificate and _clientSslKey . The documentation is available here:

https://developers.google.com/apps-script/reference/jdbc/jdbc#getConnection(String,Object)

When a database is created in Amazon, we can add SSL support to it:

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html

As an example, if we create the MariaDB database, we just need to download the following certificate: rds-ca-2015-root.pem

And access the database with the following command:

 mysql -h mymariadbinstance.abcd1234.rds-us-east-1.amazonaws.com --ssl-ca=[full path]rds-combined-ca-bundle.pem --ssl-verify-server-cert 

And apply SSL to a specific user:

 GRANT USAGE ON *.* TO 'encrypted_user'@'%' REQUIRE SSL 

So, how can we bind SSL to an Amazon database using the GAS JDBC API?

+5
source share
1 answer

The question is not entirely clear to me, but it looks like you are asking how you can transfer the server certificate when initializing the jdbc connection. The API has an argument _serverSslCertificate which should do just that.

https://developers.google.com/apps-script/reference/jdbc/jdbc#getConnection(String,Object)

Give it a try and let us know if you still have problems.

0
source

All Articles