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.