Getting error "An SSL error has occurred and a secure connection to the server cannot be made" when logging in with Realm on iOS

When calling the login(credentials:) function, some of my users are getting the following error:

An SSL error has occurred and a secure connection to the server cannot be made.

According to this SO post, this has to do with iOS allowance of external connections since iOS 9.

The error occurred on iPhone 12 pro, iOS 14.6, RealmSwift v10.8.0. The user tried uninstalling the app and reinstalling it already.

Has this problem been experienced already?

To make sure that MongoDB can be accessed correctly, which domains should be added to the NSExceptionDomains, as stated by the second most voted answer of the SO post?

I’ve seen that problem in the iOS 15 beta with 15’s private relay turned on. Turning private relay off temporarily fixed it.