Message-ID: From: "YuGe (@YuGe)" To: "pgjdbc/pgjdbc" Date: Wed, 04 Oct 2017 01:27:34 +0000 Subject: [pgjdbc/pgjdbc] issue #975: Version from 42.1.0 can't connect to 127.0.0.1 with System SOCKS proxy List-Id: X-GitHub-Author-Id: 6160918 X-GitHub-Author-Login: YuGe X-GitHub-Issue: 975 X-GitHub-Milestone: 42.2.0 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: closed X-GitHub-Type: issue X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/975 Content-Type: text/plain; charset=utf-8 Hi, I found Postgresql JDBC Driver cannot connect to local postgresql server when I set a system SOCKS proxy. org.postgresql.util.PSQLException: The connection attempt failed. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:275) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) at org.postgresql.jdbc.PgConnection.(PgConnection.java:194) at org.postgresql.Driver.makeConnection(Driver.java:450) at org.postgresql.Driver.connect(Driver.java:252) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:208) at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:201) at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.doGetConnection(UnpooledDataSource.java:196) at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:93) at org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:404) ....... Caused by: java.net.UnknownHostException: 127.0.0.1 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at org.postgresql.core.PGStream.(PGStream.java:68) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:144) ... 69 more system: macOS High Sierra java: 1.8.0_144