regenerate keystore if it's lost
postgresql: accept empty db_host as localhost
ssl: add ordering requirement
Merge pull request #2 from DavidS/master

a few fixes