mongodb-haskell/mongodb

doesn't work on MongoDB 6.0

fumieval opened this issue · 7 comments

The current version is unable to authenticate on MongoDB 6.0. I thought the cause is the end of support for SCRAM-SHA-1, but it's not the only reason; apparently there is a significant change in the authentication protocol, but I wasn't able to figure out what exactly changed.

Here's my patch which adds support for SCRAM-SHA-256, however it fails in the first step due to the following error:

[ ok: 0, errmsg: "(Unauthorized) not authorized on admin to execute command { find: \"$cmd\", filter: { saslStart: 1, mechanism: \"SCRAM-SHA-256\", payload: \"biwsbj13ZWZpdCxyPXgzcHBzZitSUTBuWWJ5YkhlMHZ2bUE9PQ==\", autoAuthorize: 1 }, batchSize: 1, limit: 1, $db: \"admin\", projection: {  } }", code: 8000, codeName: "AtlasError"]

fumieval@6e79777

This breaks sydtest-mongo:
NorfairKing/sydtest@6fc76ff

I have tried @fumieval 's patch for SCRAM-SHA256 and it works on MongoDB 5.x but not on 6.0.

Any progress on how to connect through this driver?

@khazaddum It needs to follow the latest protocol too: #144

@fumieval I am able to login against Mongo Atlas which as far as I know uses Mongo DB 6.0 behind the curtains. (I do have write issues but that's another story). Is it possible that your issue has another cause than plain Mongo DB 6.0 incompatibility?

Now that #144 is merged, this can be closed.

@why-not-try-calmer I suppose you are using the up-to-date version of this library?

Now that #144 is merged, this can be closed.

@why-not-try-calmer I suppose you are using the up-to-date version of this library?

I think I am using a recent version from a stackage snapshot less than one year old.

In any case I plan on making a PR to beef up the tests. I think we need a test matrix covering 4.0, 5.0, 6.0 + one Mongo Atlas endpoint. Expect this PR soonish. This will give us a good baseline for discussing these things.

There you go: #150.
Test results are not too bad, with 1 failure for 6 and 7 (same failure): https://github.com/why-not-try-calmer/mongodb/actions/runs/6803749735