Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCRAM channel binding check failed #582

Open
duncte123 opened this issue Nov 12, 2022 · 3 comments
Open

SCRAM channel binding check failed #582

duncte123 opened this issue Nov 12, 2022 · 3 comments

Comments

@duncte123
Copy link

duncte123 commented Nov 12, 2022

Workaround

For the people looking for a workaround: use this lib instead https://mvnrepository.com/artifact/org.postgresql/postgresql

Original issue

When setting ssl.mode to require on a hosted server (psql version 15.1) I get the following exception, it does work if I disable SSL in my settings somehow

jdbc uri:

jdbc:pgsql://(digital ocean hosted db)/skybot?user=skybot&password=REDACTED&ssl.mode=require

Exception

12-11-2022 11:56:46 main  HikariPool      ERROR  HikariPool-1 - Exception during pool initialization.
com.impossibl.postgres.jdbc.PGSQLSimpleException: Connection Error: SCRAM channel binding check failed
	at com.impossibl.postgres.jdbc.ErrorUtils.makeSQLException(ErrorUtils.java:197)
	at com.impossibl.postgres.jdbc.ErrorUtils.makeSQLException(ErrorUtils.java:134)
	at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:326)
	at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:279)
	at com.impossibl.postgres.jdbc.PGDriver.connect(PGDriver.java:104)
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359)
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100)
	at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
	at ml.duncte123.skybot.database.PostgreDatabase.<init>(PostgreDatabase.kt:56)
	at ml.duncte123.skybot.Variables.getDatabase(Variables.java:176)
	at ml.duncte123.skybot.commands.fun.TagCommand.<init>(TagCommand.java:63)
	at ml.duncte123.skybot.CommandManager.<init>(CommandManager.java:281)
	at ml.duncte123.skybot.Variables.<init>(Variables.java:90)
	at ml.duncte123.skybot.SkyBot.<init>(SkyBot.java:67)
	at ml.duncte123.skybot.SkyBot.main(SkyBot.java:187)
Exception in thread "main" com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Connection Error: SCRAM channel binding check failed
	at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:596)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:582)
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100)
	at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
	at ml.duncte123.skybot.database.PostgreDatabase.<init>(PostgreDatabase.kt:56)
	at ml.duncte123.skybot.Variables.getDatabase(Variables.java:176)
	at ml.duncte123.skybot.commands.fun.TagCommand.<init>(TagCommand.java:63)
	at ml.duncte123.skybot.CommandManager.<init>(CommandManager.java:281)
	at ml.duncte123.skybot.Variables.<init>(Variables.java:90)
	at ml.duncte123.skybot.SkyBot.<init>(SkyBot.java:67)
	at ml.duncte123.skybot.SkyBot.main(SkyBot.java:187)
Caused by: com.impossibl.postgres.jdbc.PGSQLSimpleException: Connection Error: SCRAM channel binding check failed
	at com.impossibl.postgres.jdbc.ErrorUtils.makeSQLException(ErrorUtils.java:197)
Caused by: com.impossibl.postgres.jdbc.PGSQLSimpleException: Connection Error: SCRAM channel binding check failed
	at com.impossibl.postgres.jdbc.ErrorUtils.makeSQLException(ErrorUtils.java:134)
	at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:326)
	at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:279)
	at com.impossibl.postgres.jdbc.PGDriver.connect(PGDriver.java:104)
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359)
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
	... 9 more
@mipper
Copy link

mipper commented Jan 12, 2023

I get the same thing.

java.lang.RuntimeException: com.impossibl.postgres.jdbc.PGSQLSimpleException: Connection Error: SCRAM channel binding check failed

Caused by: com.impossibl.postgres.jdbc.PGSQLSimpleException: Connection Error: SCRAM channel binding check failed
	at com.impossibl.postgres.jdbc.ErrorUtils.makeSQLException(ErrorUtils.java:197)
	at com.impossibl.postgres.jdbc.ErrorUtils.makeSQLException(ErrorUtils.java:134)
	at com.impossibl.postgres.jdbc.ConnectionUtil.createConnection(ConnectionUtil.java:326)
	at com.impossibl.postgres.jdbc.AbstractDataSource.createConnection(AbstractDataSource.java:125)
	at com.impossibl.postgres.jdbc.PGDataSource.getConnection(PGDataSource.java:71)
	at com.impossibl.postgres.jdbc.PGDataSource.getConnection(PGDataSource.java:63)
	... 30 more

@clrxbl
Copy link

clrxbl commented Jun 8, 2023

Can confirm that this is still happening. Disabling SSL isn't an option here since our PostgreSQL server requires it.

@duncte123
Copy link
Author

Can confirm that this is still happening. Disabling SSL isn't an option here since our PostgreSQL server requires it.

I ended up switching to https://mvnrepository.com/artifact/org.postgresql/postgresql. It solved all my issues with this lib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants