SSL=on at postgresql.conf and restarted the server.
But when I am trying to connect I get the following error:
FATAL: no pg_hba.conf entry for host "10.0.0.34", user "postgres", database "postgres", SSL off
Please tell me why I get this error.
It appears you're not connecting securely and there's no access from your IP specified in pg_hba.conf. You'll need to change that file and restart the service.