Search Postgresql Archives

Force ssl connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




     Howdy,

I want to prevent any Postgresql database connection other than SSL but it didn't work and my client can connect without SSL!

* How can fix this issue?

P.S. To force SSL connection I made the following steps:

On server side (ubuntu 12.10 x64 - Postgresql 9.1)
1) Created server.key and server.crt
2) Modified pg_hba.conf and added "hostnossl  all  all  0.0.0.0/0 reject"
3) Modified postgresql.conf "ssl = on"
4) Restarted the server

On client side (Qt 5.1)
db.setDatabaseName("mydb");
db.setHostName("localhost");
db.setUserName("postgres");
db.setPassword("****");
db.setPort(5432);
db.setConnectOptions("requiressl=1");
if (!db.open()) {
    qDebug() << "Unable to connect!";
}

--
Best Regards,
Muhammad Bashir Al-Noimi



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux