I'm trying to follow the diesel.rs tutorial using PostgreSQL. When I get to the Diesel setup step, I get an "authentication method 10 not supported" error. How do I resolve it?
-
1Hi chasahodge! It may be helpful if you update your question with the full error message and detailed explanation when the error appears. – MaxV Oct 22 '20 at 03:11
-
You are using [scram authentication](https://www.postgresql.org/docs/current/auth-password.html) on the server and an outdated client library that doesn't support it – Oct 22 '20 at 05:22
-
@a_horse_with_no_name (love the name; one of the first songs I learned on the guitar): That is the whole Error Message.. Thanks for your help. – chasahodge Oct 22 '20 at 15:35
3 Answers
You have to upgrade the PostgreSQL client software (in this case, the libpq used by the Rust driver) to a later version that supports the scram-sha-256
authentication method introduced in PostgreSQL v10.
Downgrading password_encryption
in PostgreSQL to md5
, changing all the passwords and using the md5
authentication method is a possible, but bad alternative. It is more effort, and you get worse security and old, buggy software.

- 209,280
- 17
- 206
- 263
-
5I’m using PostgreSQL 13. I changed the pg_hba.conf file setting the Authentication Method to trust and then the password_encryption to md5 in the postgresql.conf file. Both files reside in the /share/postgresql folder. Haven’t changed the password since I edited those files so I’ll try that now and see what happens – chasahodge Oct 22 '20 at 15:43
-
2
-
-
1
-
@LaurenzAlbe you mean by client any software ? My colleagues use an [http://download.osgeo.org/postgis/windows/extras/archive/](old soft) to import datas inPostGIS. I can't update libs myself. If I understand well either I change method in postgresql.conf AND pg_hba.conf (pg13) with md5 or we have to abandon the plugin we were used to use ? – Leehan Feb 25 '21 at 16:27
-
@Leehan Abandon that software. Anything that old is a liability, not only security-wise. – Laurenz Albe Feb 25 '21 at 16:32
-
-
This isn't a Rust-specific question; the issue applies to any application connecting to a Postgres DB that doesn't support the scram-sha-256 authentication method. In my case it was a problem with the Perl application connecting to Postgres.
These steps are based on a post.
You need to have installed the latest Postgres client.
The client bin directory (SRC
) is "C:\Program Files\PostgreSQL\13\bin" in this example. The target (TRG
) directory is where my application binary is installed: "C:\Strawberry\c\bin". My application failed during an attempt to connect the Postgres DB with error "... authentication method 10 not supported ...".
set SRC=C:\Program Files\PostgreSQL\13\bin
set TRG=C:\Strawberry\c\bin
dir "%SRC%\libpq.dll" # to see the source DLL
dir "%TRG%\libpq__.dll" # to see the target DLL. Will be replaced from SRC
cp "%SRC%\libpq.dll" %TRG%\.
cd %TRG%
pexports libpq.dll > libpq.def
dlltool --dllname libpq.dll --def libpq.def --output-lib ..\lib\libpq.a
move "%TRG%"\libpq__.dll "%TRG%"\libpq__.dll_BUP # rename ORIGINAL name to BUP
move "%TRG%"\libpq.dll "%TRG%"\libpq__.dll # rename new DLL to ORIGINAL
At this point I was able successfully connect to Postgres from my Perl script.
The initial post shown above also suggested to copy other DLLs from source to the target:
libiconv-2.dll
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
libintl-8.dll
However, I was able to resolve my issue without copying these libraries.

- 61
- 3
-
Other alternatives is just to update file libpq.dll into the newest one thats support SCRAM-256. You could find related specific library in https://wiki.postgresql.org/wiki/List_of_drivers#Drivers. In my-case i'm update the libpq.dll from https://www.exefiles.com/en/dll/libpq-dll/ – YGautomo Nov 20 '22 at 15:09