Created
March 15, 2015 18:19
-
-
Save biesnecker/d7db8a64ab62355e1122 to your computer and use it in GitHub Desktop.
Connect to an Amazon RDS instance over SSL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require db openssl) | |
; connect to a Amazon RDS MySQL instance using SSL | |
(define sslcontext | |
(let ([ctx (ssl-make-client-context 'tls)]) | |
(ssl-load-verify-root-certificates! ctx "./rds-combined-ca-bundle.pem") | |
(ssl-set-verify! ctx #t) (ssl-set-ciphers! ctx "DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2") | |
(ssl-seal-context! ctx) | |
ctx)) | |
(define mysqldb (mysql-connect | |
#:server "example.host.rds.amazonaws.com" | |
#:port 3306 | |
#:database "database_name" | |
#:user "username" | |
#:password "password" | |
#:ssl 'yes | |
#:ssl-context sslcontext)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment