-
Notifications
You must be signed in to change notification settings - Fork 4.1k
CockroachCloud asked for disabled authentication method: cleartext #65117
Description
I received the following message when coding in Crystal-lang (https://github.com/will/crystal-pg) while attempting to connect to CockroachCloud. As indicated in the message: "Caused by: server asked for disabled authentication method: cleartext", it appears that CockroachCloud is asking for cleartext authentication. I used the connection string provided by CockroachCloud which includes "sslmode=verify-full" and the path to the downloaded certificate file.
I managed to connect to CockroachCloud successfully by adding cleartext to auth_methods (i.e. auth_methods=cleartext,md5,scram-sha-256) but my concern is that this may not be secure in the long run. Also, prior to writing the Crystal-lang code, I have no issues connecting to CockroachCloud using the secure connection string provided by CockroachCloud with "sslmode=verify-full" and path to the certificate file (i.e. cockroach sql --url ..,). Please advise.
Unhandled exception: (DB::ConnectionRefused) from lib/db/src/db/connection.cr:34:0 in 'initialize' from lib/pg/src/pg/connection.cr:7:5 in 'new' from lib/pg/src/pg/driver.cr:3:5 in 'build_connection' from lib/db/src/db/database.cr:57:9 in '->' from /usr/share/crystal/src/primitives.cr:255:3 in 'build_resource' from lib/db/src/db/pool.cr:47:34 in 'initialize' from lib/db/src/db/pool.cr:40:5 in 'new:initial_pool_size:max_pool_size:max_idle_pool_size:checkout_timeout:retry_attempts:retry_delay' from lib/db/src/db/database.cr:56:15 in 'initialize' from lib/db/src/db/database.cr:49:5 in 'new' from lib/db/src/db.cr:155:5 in 'build_database' from lib/db/src/db.cr:151:5 in 'build_database' from lib/db/src/db.cr:119:5 in 'open' from src/testcrycock.cr:30:6 in '__crystal_main' from /usr/share/crystal/src/crystal/main.cr:110:5 in 'main_user_code' from /usr/share/crystal/src/crystal/main.cr:96:7 in 'main' from /usr/share/crystal/src/crystal/main.cr:119:3 in 'main' from __libc_start_main from _start from ??? Caused by: server asked for disabled authentication method: cleartext (PQ::ConnectionError) from lib/pg/src/pq/connection.cr:283:9 in 'check_auth_method!' from lib/pg/src/pq/connection.cr:264:9 in 'handle_auth' from /usr/share/crystal/src/kernel.cr:102:9 in 'connect' from lib/pg/src/pg/connection.cr:14:9 in 'initialize' from lib/pg/src/pg/connection.cr:7:5 in 'new' from lib/pg/src/pg/driver.cr:3:5 in 'build_connection' from lib/db/src/db/database.cr:57:9 in '->' from /usr/share/crystal/src/primitives.cr:255:3 in 'build_resource' from lib/db/src/db/pool.cr:47:34 in 'initialize' from lib/db/src/db/pool.cr:40:5 in 'new:initial_pool_size:max_pool_size:max_idle_pool_size:checkout_timeout:retry_attempts:retry_delay' from lib/db/src/db/database.cr:56:15 in 'initialize' from lib/db/src/db/database.cr:49:5 in 'new' from lib/db/src/db.cr:155:5 in 'build_database' from lib/db/src/db.cr:151:5 in 'build_database' from lib/db/src/db.cr:119:5 in 'open' from src/testcrycock.cr:30:6 in '__crystal_main' from /usr/share/crystal/src/crystal/main.cr:110:5 in 'main_user_code' from /usr/share/crystal/src/crystal/main.cr:96:7 in 'main' from /usr/share/crystal/src/crystal/main.cr:119:3 in 'main' from __libc_start_main from _start from ???