Enable SSL support for pgsql

In phpinfo() , the pgsql SSL support section is currently disabled :

enter image description here

How to enable it?

+4
source share
3 answers

This is truly Pgsql SSL support.

The libpq library is probably not compiled with SSL support. Did you create the pgsql and / or libpg package yourself? If so, you can enable it by compiling with the --with-openssl option

If you did not compile it yourself, try finding a package with built-in SSL.

+2
source

First, you need to determine "How has your current PostgreSQL extension been compiled?" (Is compiled into the main PHP executable or Loadable).

Determining the compilation of the current PGSQL extension:

  • View the contents of your php.ini file
  • Find a line like "extension = php_pgsql.so (should be php_pgsql.dylib)

If you find a string like this, then your extension is a loadable module. If it has a semicolon in front, your extension is part of the main PHP executable.

If this is a downloadable extension, then you can search the Internet with the hope that someone previously compiled the PGSQL extension with SSL support for a particular OS. If your extension is part of the main PHP executable, then find the OS distribution that is enabled with SSL support.

If you still cannot solve your problem, you need to build / compile the PostgreSQL extension against the libpq version, which, in turn, was compiled with SSL support.

Hope this helps!

+1
source

In one of your databases (e.g. postgres db administration), issue show ssl; . If it returns "off", edit the postgresql.conf file and change the line "ssl = off" to "ssl = on" and reload the configuration (problem "select pg_reload_conf ()" as the superuser).

More information on ssl support can be found in the docs: http://www.postgresql.org/docs/9.2/static/ssl-tcp.html

0
source

Source: https://habr.com/ru/post/1493224/


All Articles