r/visualbasic • u/MrX-1969 • Apr 21 '24
Need Help Connecting VB6 App in Win XP (Embedded) to Azure SQL Server with TLS 1.2 Support
Hi everyone,
I’m working with a legacy VB6 application that's currently undergoing a major redevelopment, expected to take a few more years. This application runs in a virtualised Windows XP Embedded environment due to compatibility issues with certain third-party components that we can't get to work on Windows 10/11.
Our immediate challenge is connecting this application to an Azure SQL Server. The primary issue is the lack of TLS 1.2 support in the available ODBC drivers for Windows XP. I've explored some suggestions to enable TLS 1.2 on XP and tried using the "SQLNCLI11" provider, but I haven't been able to find an ODBC driver that installs on Windows XP.
Has anyone faced and solved this before? or can anyone suggest a workaround that doesn't involve moving the development environment or a full application rewrite at this stage? Due to the size of the App and the way its been coded, its not feasible at this point to consider an API solution either.
Appreciate any experiences you might share.
Thanks!
3
u/Ok_Society4599 Apr 21 '24
TLS is generally provided by the OS rather than the app and (as best I recall) wasn't available is WinXP. There were some registry settings for Win10/11 that can turn it on -- been a few years since I needed it. These days, it's turned on by Group Policy.
I've hacked a few 3rd party control sets to install on Windows 10 when the installers wouldn't run on "unsupported platforms." Generally, it's running a monitor while running the installer on a clean Windows XP system(VM). That should tell you all the binaries and their locations, as well as all the registry settings... Copy them to Win 10/11 VM, then run you VB6 app. Then you can use the registry to turn on TLS.
At one point, I used the monitored install to move some third-party controls to Win7 when it was unsupported and the controls were no longer being maintained. We just included their redistributable binaries in our installer.
3
u/Mayayana Apr 22 '24
I don't know anything about ODBC, but you can enable TLS1.2 in XP. First, save the following to a .reg file and run it:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client] "DisabledByDefault"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server] "DisabledByDefault"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] "DisabledByDefault"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] "DisabledByDefault"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\WPA\PosReady] "Installed"=dword:00000001
The PosReady setting is necessary because XP updates won't install on XP anymore unless it's "marked" as embedded.
Next, download this update and run it. Then reboot. http://download.windowsupdate.com/c/msdownload/update/software/updt/2017/10/windowsxp-kb4019276-x86-embedded-enu_3822fc1692076429a7dc051b00213d5e1240ce3d.exe
This worked fine for me using winhttp where TLS 1.2 was needed.
2
u/Low-Difference-6921 Apr 22 '24
After you get TLS1.2 enabled on the OS, if the vb6 components become the issue you can use dotnet components and then interop from vb6 to the dotnet component
3
u/Ok_Society4599 Apr 21 '24
Have you considered installing SQL Server, then adding your Azure Server as Linked Server? That would improve your isolation of the dependency.
2
u/jd31068 Apr 22 '24
You could create an .NET API that talks to the database and just have the VB6 app get its data from there.