It could be configuration mistake in your server configuration. I would suggest that you install the server and use Windows as authentication pattern, allow HTTP and in the websocket origin white list add the IP-address for the computer or the hole domain by yourdomain.com and this code should work.
var location = Location.FromUri(new Uri("http://yourserver.com));
using (var hub = location.Hub(noVersionCheck:true))
foreach (var appId in location.GetAppIdentifiers())
This was one of the answer for difference thread, but thought worth having it here for some one who need in the future
I am not well experienced .Net developer(neither C#). However I was able to connect to the server using some of the code provided in https://github.com/AptkQlik/PublicExamples
I used the method in ConnectDirectRemoteServer . However I guess if the SSl is enabled there may be an issue with code. I had to set certificateValidation: false to the AsDirectConnection method
location.AsDirectConnection("domain", "user", certificateCollection: certificateCollection);
location.AsDirectConnection(“user directory name", "user_id", certificateValidation: false, certificateCollection: certificateCollection);
This code to be worked, need to export certificate into the remote server where you run this code.
Also worth checking the following been setup (I did not want to set allow http in QMC or Windows authentication patterns to windows as it mentioned, but had to allow firewall to accept 4747 port and allow request from my ip to the server)