Can someone explain whats going on and the difference between the two configure versions.
You can run ./configure --help
to get a synopsis of arguments:
$ ./configure --help | egrep -i '(ssl|includes)'
--with-includes=DIRS look for additional header files in DIRS
--with-openssl build with OpenSSL support
./configure --with-openssl
This simply enables OpenSSL in Postgres. It enables checking in Autoconf, like probing for symbols CRYPTO_new_ex_data
and SSL_Library_init
.
It also looks like configure defines #define USE_OPENSSL 1
which activates OpenSSL code paths:
$ grep -IR OPENSSL * | grep '.c'
...
src/backend/postmaster/fork_process.c:#ifdef USE_OPENSSL
src/backend/postmaster/fork_process.c:#ifdef USE_OPENSSL
src/backend/utils/init/postinit.c:#ifdef USE_OPENSSL
src/backend/utils/init/postinit.c:#ifdef USE_OPENSSL
src/include/libpq/libpq-be.h:#ifdef USE_OPENSSL
src/include/libpq/libpq-be.h:#ifdef USE_OPENSSL
...
./configure --with-includes=/usr/local/ssl/include
This probably did not enable OpenSSL. It simply added a path for headers that were not used during compilation. Use ldd
on Linux and otool -L
on OS X to see if there are any OpenSSL dependencies.
You should probably use ./configure --with-openssl --with-includes=/usr/local/ssl/include --with-libraries=/usr/local/ssl/lib
. You should probably add CFLAGS="-Wl,-rpath=/usr/local/ssl/lib
to ensure proper runtime linking.
Also see Postgres Issue 14308: Postgres 9.5.4 does not configure against OpenSSL 1.1.0