alaisi / postgres-async-driver

Asynchronous PostgreSQL Java driver
Apache License 2.0
287 stars 38 forks source link

Connecting to server waited endlessly #22

Open chang-chao opened 8 years ago

chang-chao commented 8 years ago

I'm running com.github.pgasync.impl.AuthenticationTest.shouldThrowExceptionOnInvalidCredentials() junit test on the master,with minor changes of the host to a remote server (posgresql 8.4) in my LAN . and the test freezes waiting for something.

Please see the attached packet capture.

capture.zip

chang-chao commented 8 years ago

It seemes that it has something to do with the implementation of com.github.pgasync.impl.DatabaseRule.createPoolBuilder(int),which set the ssl property to true.When ssl is set to false,the test passed.

chang-chao commented 8 years ago

This is output of pg_config,which says that when postgresql is compiled,ssl is not enabled. Which means that postgres is compiled without the ssl enabled but ssl property of ConnectionPoolBuilder is set to true in the client by mistake,connecting to db can last for a long time without any error.

C:\Program Files\PostgreSQL\9.4\bin>pg_config.exe
BINDIR = C:/PROGRA~1/POSTGR~1/9.4/bin
DOCDIR = C:/PROGRA~1/POSTGR~1/9.4/doc
HTMLDIR = C:/PROGRA~1/POSTGR~1/9.4/doc
INCLUDEDIR = C:/PROGRA~1/POSTGR~1/9.4/include
PKGINCLUDEDIR = C:/PROGRA~1/POSTGR~1/9.4/include
INCLUDEDIR-SERVER = C:/PROGRA~1/POSTGR~1/9.4/include/server
LIBDIR = C:/PROGRA~1/POSTGR~1/9.4/lib
PKGLIBDIR = C:/PROGRA~1/POSTGR~1/9.4/lib
LOCALEDIR = C:/PROGRA~1/POSTGR~1/9.4/share/locale
MANDIR = C:/Program Files/PostgreSQL/9.4/man
SHAREDIR = C:/PROGRA~1/POSTGR~1/9.4/share
SYSCONFDIR = C:/Program Files/PostgreSQL/9.4/etc
PGXS = C:/Program Files/PostgreSQL/9.4/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = --enable-thread-safety --enable-integer-datetimes --enable-nls --with-ldap --with-ossp-uuid --with-libxml --with-libxslt --with-tcl --with-perl --with-python
VERSION = PostgreSQL 9.4.5