Re: pgsql-jdbc and ident

Поиск
Список
Период
Сортировка
От Matt Rose
Тема Re: pgsql-jdbc and ident
Дата
Msg-id 20130304151111.GC12543@oscar.engineering.n-able.com
обсуждение исходный текст
Ответ на Re: pgsql-jdbc and ident  (Ian Pilcher <arequipeno@gmail.com>)
Список 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@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


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Ian Pilcher
Дата:
Сообщение: Re: pgsql-jdbc and ident
Следующее
От: Jeremy Whiting
Дата:
Сообщение: Re: executeUpdate API contract. Return value equals 0.