In the past, there has been lots of productive discussion on how to mount drives programmatically.
This link is one productive example: How do I map a network drive that requires a username and password in .NET?
However, what I seem to be missing is a way to perform this mount when TLS is required.
We see things like this: net.exe use x: "\server.com@ssl:443\folder" /User:UserName Password
Where this can be used in code with:
System.Diagnostics.ProcessStartInfo process = new System.Diagnostics.ProcessStartInfo();
process.FileName = "net.exe";
process.Arguments = "use Z: \\\\JoeDoodle.TheDomain5.com@SSL\\MyFolder\\ PassW0rd /user:JoeUser";
process.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(process);
// Other stuff...
This sort of thing works great with SSL but not TLS. This is a .Net 4.0 application with our test base starting on Windows 7. Since we are running this as process as shown I am not sure not much that matters.
I cannot use WNetAddConnection2 and related imports because this is a remote drive. The other end is Linux exposing Webdav and it works fine for SSL but not TLS specifically. They are phasing out SSL so I must use TLS.
Any way to mount it programmatically will probably be fine with TLS but I just haven't found the successful combination.
Any help is appreciated.