Add support for EPA#682
Conversation
|
@mmcnabb-vms Can you look at this? Will this be merged at all or am I trying in vain? |
|
Yes, surely a good feature to have. There's no rush I think, I saw the PR but the initial state was a bit messy so I waited. |
freddy is the maintainer, I'm just a random contributor :) working on other issues at the moment |
|
@freddy77 Can you help me build freetds for windows? I've never done it before and I could not build it with Visual Studio Code 2022. Maybe there is a documentation how to configure viausl studio code 2022? solved by install perl |
|
Good you fixed the Perl issue. About the error from |
|
If I build with in Visual Studio Code with the folowing CMakeSettings.json Then it finds BIO_get_data I don't understand why it uses x86 compiler, I don't know how to specity else if I specified via |
|
It looks like your environment is compiling for x64 but trying to link to x86. I would try to use Maybe you launched the wrong environment by mistake (if using command line) ? Also Windows should use SSPI so |
|
Thank you. I managed to compile on Windows. I didn't notice the import pyodbc
import os
conn = (
"DRIVER=FreeTDSCustom;"
"SERVER=127.0.0.1;"
"Database=msdb;"
"Port=1433;"
"Trusted_Connection=yes;"
)
print("localhost version: ", pyodbc.connect(conn).execute("SELECT @@VERSION").fetchone()) |
|
If you have any questions about how to test, how to troubleshoot the connection, or how to configure the SQL Server or enable the EPA, I will be happy to help. |
|
Currently testing changes to Work:
Do no work:
I still need to setup an AD domain to test GSSAPI. Update: GSSAPI works too (this also with required encryption off). Other update (25th November) It looks like the "required encryption" issue is bound to the current poor implementation of NTLM code which lacks MIC. It looks like that if "required encryption" is off the server does not require channel binding (NTLM login with empty channel binding is accepted if using SSPI). I still need to test SSPI implementation (I tried without your changes and works with "required encryption" off). |
|
I can't get channel binding working for TLS 1.3. First, I wrote a golang implementation of the tls-exporter. The channel binding implementation was simple, but I didn't understand how Microsoft calculated it. Do you know which DLL or binary I could reverse to understand the secret? I also want to point out that we need to test this on fresh MSSQL servers, as Microsoft Server 2019 does not support TLS 1.3 and when you use the encrypt=strict option, you will be using TLS 1.2 instead. And very old mssql servers have channel binding checks broken, they ignore them even if you set Enhanced Protection = Required |
I suppose then your code it's not working. Looking around I would look at "token bindings" (rfc 8471) instead of tls exporter and rfc 9266. The DLL should be
I'm getting TLS 1.3 on w2022, just adding some registry keys.
I don't think we can do anything about it. Unless we suggest to just force encryption at the client level. |
|
I don't see any tls extensions with token binding in Client Hello message. |
|
Maybe we can skip this for tds 8.0 and tls 1.3? |
Yes, already working on it, testing is part one. About TLS 1.3 is even possible that simply they "trust it", in the sense that with strict mode the certificate is required and all encrypted too so you can't have much man in the middle. |
|
The proposed version is at https://github.com/freddy77/freetds/commits/epa/. Changes I did:
You can see the full changes at https://github.com/freddy77/freetds/commits/epa0/ (before reorganizing the series). |
Oh, I really appreciate it that you refactored, I'm not great at C and there were memory leaks left, thank you!
You are right, .qemu email is wrong, it should be the same as in other commits. And I forgot to change git name in commits and need to change B** G** to my github username.
I'll try to not send CB when using tls 1.3, maybe it will help.
I think you have a better understanding how to name commit, but I'd name this commit "Add support of Channel Binding for TLS up to 1.2" |
For the email address no issue. The name no, I need a real name. |
|
Merged. Thanks |
#679
Implement for NTLM:
Implement for Kerberos:
Implement for SSPI
Analyze the changes needed for TDS 8.0