Sorry I rejected this by accident
От | Dave Cramer |
---|---|
Тема | Sorry I rejected this by accident |
Дата | |
Msg-id | CADK3HH+E00gf=eekb+mKdMmHa4FtoM==aeQ2pfNw1Ssh5RA2Vg@mail.gmail.com обсуждение исходный текст |
Список | pgsql-jdbc |
From: Kok King Eng <des.kkeng@gmail.com>
To: pgsql-jdbc@postgresql.org
Cc:
Date: Mon, 8 Aug 2016 21:42:38 +0800
Subject: SSPI Authentication Exception
Regards,
desperado
To: pgsql-jdbc@postgresql.org
Cc:
Date: Mon, 8 Aug 2016 21:42:38 +0800
Subject: SSPI Authentication Exception
Hi,
I'm encountering exception when connecting postgres with SSPI authentication. Here's my development enviroment:
1. Postgresql 9.5 (Centos 7.2)
2. Active Directory (Windows Server 2012 R2)
3. Windows 10 Pro as development workstation
5. JKD 1.8.0.92
4. JDBC version: 9.4.1209
5. waffle-jna version: 1.8.1
6. I've also tried different jdbc version from 1200 to 1208 along with different waffle-jna version (1.5 - 1.8.1), except getting a NoSuchMethodError (java.lang.NoSuchMethodError: waffle.windows.auth.impl. WindowsSecurityContextImpl. setCredentialsHandle(Lcom/sun/ jna/platform/win32/Sspi$ CredHandle;)V) due to version compatibility issue, I keep getting the exception below attached.
I can to connect to database server with pgadmin without supplying password, so I assume my db server and environment is properly configured.
My java client works also when gsspi is used with both username & password supplied.
In debug mode, I modified the return value from org.postgresql.sspi. SSPIClient.makeSPN() from POSTGRES/pgdb-main. mydomainname.local:5432 to POSTGRES/pgdb-main. mydomainname.local (eliminate port no), I managed to connect my database without error!
and my jdbc connection string is: jdbc:postgresql://pgdb-main. mydomainname.local/dbname? gsslib=sspi
Since the method org.postgresql.sspi. SSPIClient.makeSPN() involves three parties (postgres jdbc, waffle-jna and windows api), I'm not too sure which exact party I should report to, will you please give a hint if postgres jdbc is not the cause?
and finally, here comes the exception:
org.postgresql.util. PSQLException: Could not initialize SSPI security context
at org.postgresql.sspi. SSPIClient.startSSPI( SSPIClient.java:176)
at org.postgresql.core.v3. ConnectionFactoryImpl. doAuthentication( ConnectionFactoryImpl.java: 612)
at org.postgresql.core.v3. ConnectionFactoryImpl. openConnectionImpl( ConnectionFactoryImpl.java: 223)
at org.postgresql.core. ConnectionFactory. openConnection( ConnectionFactory.java:67)
at org.postgresql.jdbc. PgConnection.<init>( PgConnection.java:212)
at org.postgresql.Driver. makeConnection(Driver.java: 407)
at org.postgresql.Driver.connect( Driver.java:275)
at java.sql.DriverManager. getConnection(DriverManager. java:664)
at java.sql.DriverManager. getConnection(DriverManager. java:208)
at com.des.Americano.main( Americano.java:37)
Caused by: com.sun.jna.platform.win32. Win32Exception: The specified target is unknown or unreachable
at waffle.windows.auth.impl. WindowsSecurityContextImpl. initialize( WindowsSecurityContextImpl. java:158)
at org.postgresql.sspi. SSPIClient.startSSPI( SSPIClient.java:174)
... 9 more
Thank you & Have a good day!I'm encountering exception when connecting postgres with SSPI authentication. Here's my development enviroment:
1. Postgresql 9.5 (Centos 7.2)
2. Active Directory (Windows Server 2012 R2)
3. Windows 10 Pro as development workstation
5. JKD 1.8.0.92
4. JDBC version: 9.4.1209
5. waffle-jna version: 1.8.1
6. I've also tried different jdbc version from 1200 to 1208 along with different waffle-jna version (1.5 - 1.8.1), except getting a NoSuchMethodError (java.lang.NoSuchMethodError: waffle.windows.auth.impl.
I can to connect to database server with pgadmin without supplying password, so I assume my db server and environment is properly configured.
My java client works also when gsspi is used with both username & password supplied.
In debug mode, I modified the return value from org.postgresql.sspi.
and my jdbc connection string is: jdbc:postgresql://pgdb-main.
Since the method org.postgresql.sspi.
and finally, here comes the exception:
org.postgresql.util.
at org.postgresql.sspi.
at org.postgresql.core.v3.
at org.postgresql.core.v3.
at org.postgresql.core.
at org.postgresql.jdbc.
at org.postgresql.Driver.
at org.postgresql.Driver.connect(
at java.sql.DriverManager.
at java.sql.DriverManager.
at com.des.Americano.main(
Caused by: com.sun.jna.platform.win32.
at waffle.windows.auth.impl.
at org.postgresql.sspi.
... 9 more
Dave Cramer
В списке pgsql-jdbc по дате отправления: