wonderix / crystal-tds

MIT License
11 stars 2 forks source link

Encryption is missing #3

Open wonderix opened 3 years ago

wonderix commented 3 years ago

It's not possible to open TLS encrypted connections

stakach commented 3 years ago

Looking at this article you need to start SSL after the connection is established. https://www.datasunrise.com/blog/professional-info/encryption-in-microsoft-sql-server/

LDAP works in a similar way, this is an example of negotiating SSL / TLS on an exising connection (the last line of this function) https://github.com/spider-gazelle/crystal-ldap/blob/master/src/ldap/client.cr#L127-L139

Hope that helps

wonderix commented 3 years ago

Thanks for this link. It really explains the handshake quite well. It's easier to understand compared to studying the freetds code.