Milestone SDK not connecting to XProtect Server

I am using the Milestone SDK to connect to an XProtect server to retrieve video data. The example code I have worked previously but now I get errors on connecting.

Here is the error I see:

MIP: Debug: ConnectionCheck:IsOAuthServerOnline (): Error(s): No authorization server found at: https://my-ip/idp/.well-known/openid-configuration: URLBlockedInternalResource
MIP: Debug: ConnectionCheck:IsOAuthServerOnline (): Error(s): No authorization server found at: http://my-ip/idp/.well-known/openid-configuration: URLBlockedInternalResource
MIP: Error: ParallelHandler:GetOAuthServerAddress (): No OAuth server found at https://my-ip/
ConnectionCheck for:http://my-ip/, Took:0ms
MIP: Debug: ConnectionCheck:IsLegacyServerOnline (): Could not establish connection to server: http://my-ip/
The thread 'FindBestAddress thread http://my-ip/' (36816) has exited with code 0 (0x0).
ConnectionCheck for:https://my-ip/, Took:5ms
MIP: Debug: ConnectionCheck:IsLegacyServerOnline (): Could not establish connection to server: https://my-ip/
The thread 'FindBestAddress thread https://my-ip/' (27368) has exited with code 0 (0x0).
MIP: Error: FindBestAddress (): No server found on address: https://my-ip/
ConstructLoginServer: Unable to identify server type:my-ip
MIP: Error: SDKConfiguration.Login(Uri) (): Unable to login on server URI=https://my-ip/
Exception thrown: 'VideoOS.Platform.SDK.Platform.ServerNotFoundMIPException' in VideoOS.Platform.SDK.dll

I know the most likely cause of this error is that the XProtect server is not running or there is no connection route from my client system to the XProtect server. However:

  • I checked in a web browser from the client machine and I can access URL endpoints like https://my-ip/idp/.well-known/openid-configuration and get a response
  • The XProtect server appears to be up and running as I can run the XProtect client on the same system as my test client and log into the server.
  • The error message is saying that it cannot find the authorization server, but when I run Wireshark on my client system it shows no traffic between the client and the server. So, the error message says it could not find these endpoints but Wireshark says the traffic never got out of my client system and onto the network.

Is there any common reason why the Milestone SDK would fail to open a connection to the XProtect server and thrown an error like this? The code I am currently using is:

Guid integrationId = new Guid();
string integrtationName = "name";
string version = "1";
string manufacturerName = "Test";
 
VideoOS.Platform.SDK.Environment.Initialize();
VideoOS.Platform.SDK.Export.Environment.Initialize();
 
Uri serverUri = new UriBuilder("https", "my-ip", 443).Uri;
CredentialCache cc = VideoOS.Platform.Login.Util.BuildCredentialCache(serverUri, "user", "pass", "Basic");
VideoOS.Platform.SDK.Environment.AddServer(false, serverUri_, cc, true);
VideoOS.Platform.SDK.Environment.Login(serverUri, integrationId, integrtationName, version, manufacturerName);

My server is XProtect 2023 R3 and I am using MilestoneSystems.VideoOS.Platform.SDK version 23.1.3.

Please do a quick check. If you use the same credentials in the same PC in Smart Client does it log in correctly and without the warning about the server not being secure?

You could also compare to the Camera Stream Resolution sample which does a hardcoded login, if the sample works for you see how the code differs from yours.

https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/camerastreamresolution/readme.html&tree=tree_2.html

https://github.com/milestonesys

If the sample fails the same way, double check the server address you are using.

I think I found the reason, but not the fix yet. When I tried that sample code it worked just fine. I then tried making a new application and copying my code into it and that worked fine. I think the problem is that my original project has something wrong in its setup. Something like a wrong .Net version or some other library miss-match that is causing the problem. It is confusing because the error message makes it look like the XProtect server was not found when the error is really about the application environment not working right. Thanks for the advice.

If you find the root cause I’d be interested to know, perhaps it will be possible to change the SDK or documentation, it would be nice if the error in this scenario would be more telling.