pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matt Rose <mrose@n-able.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: pgsql-jdbc and ident
Date: Mon, 4 Mar 2013 10:11:11 -0500
Message-ID: <20130304151111.GC12543@oscar.engineering.n-able.com> (raw)
In-Reply-To: <kh15kq$314$1@ger.gmane.org>
References: <20130301160459.GA12543@oscar.engineering.n-able.com>
	<kh15kq$314$1@ger.gmane.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@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@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@gmail.com
> Sometimes there's nothing left to do but crash and burn...or die trying.
> ========================================================================
> 
> 
> 
> -- 
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc

-- 
Matt Rose, Systems Engineer, N-able Technologies: mrose@n-able.com


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (4+ messages)

Message-ID: <20130304151111.GC12543@oscar.engineering.n-able.com>
Permalink:  ../20130304151111.GC12543@oscar.engineering.n-able.com/
Also on:    postgresql.org/message-id/20130304151111.GC12543@oscar.engineering.n-able.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mrose@n-able.com
  Subject: Re: pgsql-jdbc and ident
  In-Reply-To: <20130304151111.GC12543@oscar.engineering.n-able.com>
  References: <20130301160459.GA12543@oscar.engineering.n-able.com> <kh15kq$314$1@ger.gmane.org> <20130304151111.GC12543@oscar.engineering.n-able.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox