How to conect Google Apps Script JDBC to Amazon RDS with SSL

Viewed 1473

Google launched support for SSL connections in the JDBC service. Google added three new connection parameters 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 in Amazon is created, we can add SSL support to it:

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

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

And access to database with the next 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 an specific user:

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

So, how can we conect with SSL to an Amazon Database using the GAS JDBC API?

1 Answers
Related