Re: pgsql-jdbc and ident

From: Matt Rose <mrose(at)n-able(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: pgsql-jdbc and ident
Date: 2013-03-04 15:11:11
Message-ID: 20130304151111.GC12543@oscar.engineering.n-able.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Sun, Mar 03, 2013 at 10:49:49PM -0500, Ian Pilcher wrote:
> On 03/01/2013 10:04 AM, Matt Rose wrote:
> > I am having the oddest problem with postgresql-9.2-1002.jdbc3.jar doing
> > ident authentication against postgresql-9.2.3
>
> Your ident server might be having a problem recognizing IPv6
> connections, including "IPv4-mapped IPv6 addresses" (see
> http://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses)
>
> Try running your program with -Djava.net.preferIPv4Stack=true to
> determine if your problem is IPv6-related.

Thank you, that was the problem.

[root(at)localhost ~]# java -jar /home/admin/pgtest.jar
Running as user 'root'
postgresql JDBC Driver Registered!
SQLException: FATAL: Ident authentication failed for user "sqlrelay"
SQLState: 28000
VendorError: 0
Exception in thread "main" java.lang.NullPointerException
at
net.folkwolf.PostgreSQLJDBCDriverTest.main(PostgreSQLJDBCDriverTest.java:35)
[root(at)localhost ~]# java -jar -Djava.net.preferIPv4Stack=true
/home/admin/pgtest.jar
Running as user 'root'
postgresql JDBC Driver Registered!

For some reason, even if you specify an ipv4 address in the connection
url, the jdbc driver only connects successfully over ipv6.

I have some ideas as to why this happens, but I can mull them over
later. Thanks again.

NB: Also, when I configure my ident server to listen to ipv6, and add
an ident map to pg_hba.conf to listen to ipv6 localhost, it also works.

Matt

>
> --
> ========================================================================
> Ian Pilcher arequipeno(at)gmail(dot)com
> Sometimes there's nothing left to do but crash and burn...or die trying.
> ========================================================================
>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc

--
Matt Rose, Systems Engineer, N-able Technologies: mrose(at)n-able(dot)com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jeremy Whiting 2013-03-05 14:38:31 Re: executeUpdate API contract. Return value equals 0.
Previous Message Ian Pilcher 2013-03-04 03:49:49 Re: pgsql-jdbc and ident