I have discovered that we have a problem that is related to using national Danish characters (æøåÆØÅ) in passwords.
We have an app-server where we control changes to users in the sync.gateway like creation/deletion and setting a password. I have one user that has not been able to connect to the sync.gateway and after a lot of trial/error I have found out that using one of the Danish letters in the password on the sync.gateway seems to cause a problem (not anywhere else in our application).
Is there any way I can allow this?
I have tried another special character like ! - and that works…
Sync Gateway doesn’t have any restriction around non-ASCII characters in passwords. I was able to create a user with password ‘æøåÆØÅ’ locally, and authenticate successfully as that user with that password (using basic auth).
From your description it sounds like the password might be getting modified at some point prior to reaching Sync Gateway - can you share some more details on the specific requests or operations that you’re using when you encounter the connection issue described?
Try replacing with wr.write(data.getBytes(UTF_8));
Or, since DataOutputStream isn’t doing anything useful here, write directly to the connection’s OutputStream:
OutputStream out = connection.getOutputStream()
out.write(data.getBytes(UTF_8));
out.close()
key.toUpperCase() is also dodgy since it uses the default locale, but that seems less likely to be the source of the problem. Suggested replacement would be key.toUpperCase(Locale.ROOT)
Thanks for that! It works as expected. Not sure why the code was like it was - probably just found an example back when it was set up and adjusted that to work…