fix SSL bug, and fix postgres