We are using jdbc sql server driver 4.2 and trying to connect to a database in a multi subnet Always On Availability Group. We are using SQL Server 2019 Enterprise Edition.
The connection fails with this error: SSPI handshake failed with error code 0x80090302, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The operating system error code indicates the cause of failure. The function requested is not supported
The connection is being made from an app server to the database server. All are in the same domain. All servers are Windows Server 2019.
connection string: jdbc:jtds:sqlserver:///;domain=;multiSubnetFailover=true
I did add the service account to the local policy Access this computer from the network because I had read that as a solution. I also added it to the local Administrators group on the app server.
We have SQL Server Management Server (SSMS) installed on the app server. From SSMS, we can successfully connect using the listener name and specifying MultiSubnetFailover=true. We connected as the same service account that is failing with the jdbc connection. SPN’s are registered and kerberos auth is being used for that successful connection from SSMS.
Interestingly enough, we CAN connect using jdbc to the current prod server which is in a different data center but same domain. That one is also in a multi subnet Always On Availability Group.
I don’t understand what the issue is since I can make the same connection from SSMS but it is failing with jdbc. However, with jdbc I can connect to a different database in a different Always On cluster. That tells me that the formatting is correct for the connection string. One thing to note is that in the cluster that works with jdbc, the RegisterAllProvidersIP cluster setting is set to false. In the one that is failing, it is set to true. I want to keep it true since the jdbc connection does support MultiSubnetFailover parameter. Also, it works from SSMS so shouldn’t it work with jdbc?
Thanks for any help!
user24808479 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.