The issue above is for when using Postgres as the Grafana db.
sslmode is a valid querystring parameter for a postgres connection string (and for Redshift):
http://docs.aws.amazon.com/redshift/latest/mgmt/connecting-ssl-support.html
What is the error you are getting? Usually it says something more than just 500.