stijnsanders / TMongoWire

Delphi MongoDB driver
MIT License
102 stars 37 forks source link

I can not log in MongoDB Atlas #45

Closed orsiniaguiar closed 6 years ago

orsiniaguiar commented 6 years ago

How do I connect to MongoDB Atlas? I'm using unit mongoAuth3.pas

stijnsanders commented 6 years ago

I'm sorry that I haven't answered sooner. I need to schedule some time to open a trial account with MongoDB Atlas and have a test-environment to run mongoAuth3.pas in the debugger. If you want you can help by trying yourself: demove all {$D-} clauses, and step through the connection and authentication phase when connecting. Then find out exactly where the connection is denied.

stijnsanders commented 6 years ago

I tried with a free M0 cluster on MongoDB Atlas. Apparently SSL is enabled, and I haven't found a configuration to disable this (which may be by design). TMongoWire currently doesn't support SSL. I'll haven't worked much with SSL/TLS yet, so I'm not sure how to extend simpleSock.pas with SSL support.

stijnsanders commented 6 years ago

Please view my recent commit. I've added (very very basic) infrastructure to use Windows' default SSPI SChannel DLL to perform the TLS protocol, handshaking and encryption. I've tried on my test M0 cluster and appears to work fine. Please try and test heavily. Let me know if this works.

stijnsanders commented 6 years ago

Haven't heard back, I assume it's solved.