Problem solved, keys issue. I'm just not good in configuring a linuxserver. Solution is here:http://developer.postgresql.org/docs/postgres/ssl-tcp.html
I did it and then turned ssl on in the postgresql.conf file. Works.