Skip to content

Instantly share code, notes, and snippets.

@biesnecker
Created March 15, 2015 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biesnecker/d7db8a64ab62355e1122 to your computer and use it in GitHub Desktop.
Save biesnecker/d7db8a64ab62355e1122 to your computer and use it in GitHub Desktop.
Connect to an Amazon RDS instance over SSL.
(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