1

Using TRESTClient components I have added the ability of my app CW_EPG to access the SchedulesDirect.org JSON database under Windows 7 and higher, but running the app in Windows XP produces only the following error upon attempting to access the site: Error: REST request failed: Error sending data: (12007) The server name or address could not be resolved. I've tried enabling/disabling various of the controls listed in the Object Inspector, but have not succeeded in changing that error message. Am I missing something or is this Rio subsystem just incompatible with XP?

FWIW, here's the relevant code segment (the base URL is set in Object Inspector for RESTClient1 to https://json.schedulesdirect.org/20141201):

  RESTRequest1.ClearBody;
  RESTRequest1.AddBody('{"username":"' + userID
    + '", "password":"' + THashSHA1.GetHashString(userPass) + 
    '"}',ctTEXT_PLAIN);
  RESTRequest1.Method := rmPOST;
  RESTRequest1.Resource := 'token';
  RESTResponse1.RootElement := '';
  try
    RESTRequest1.Execute;
  except on E:Exception do
    begin
      ShowMessage('Error: ' + E.Message);
      exit;
    end;
  end;
Dalija Prasnikar
  • 27,212
  • 44
  • 82
  • 159
Terry Peterson
  • 121
  • 1
  • 8
  • Have you tried debugging into the `TRESTClient`'s source code at runtime to see exactly how it is parsing the REST URL and resolving the REST server name? – Remy Lebeau Apr 27 '20 at 22:13
  • @RemyLebeau, are you suggesting that it really should work on XP? I've also tried the Embarcadero REST Debugger with that URL on both Win10 and XP. It behaves similarly to my app: works on 10, fails on XP. I haven't climbed the Rio debugger's learning curve far enough to use it to debug the app running on a WinXP VM, but I guess you're saying that's what should come next, right? – Terry Peterson Apr 28 '20 at 03:32
  • Of course, you checked network connectivity on your XP VM? You can ping `json.schedulesdirect.org` successfully? – Olivier Apr 28 '20 at 07:50
  • @Olivier, yes, in fact the problem was first reported to me by a tester using a physical XP system that regularly accesses that site using an older version of my app. But your question caused me to take a look at what the error message would be with no Internet connection and the answer is, "the same". Obviously, the glitch is occurring early in the call. Unless somebody can tell me that it's hopeless I'll start climbing that learning curve suggested by Remy, but I'm not optimistic about finding a real solution at this point. :( – Terry Peterson Apr 28 '20 at 16:56
  • Another possibility is an issue with SSL (although it should give another error message). Can you browse to https://www.schedulesdirect.org with IE under XP? – Olivier Apr 28 '20 at 18:35
  • And what has changed in your app? Does the old version still work? – Olivier Apr 28 '20 at 18:38
  • @Olivier, yes, I think you've got the right idea. Windows XP cannot normally access any websites today that implement TLS 1.1/1.2. See my answer below. The change in the app was to move from SOAP calls on Schedules Direct's original database to TRESTClient calls on their newer JSON database. The old version continues to work--but that database is limited to North America while the JSON data cover much of the world. – Terry Peterson Apr 29 '20 at 18:44

1 Answers1

1

It seems that TRESTClient will work in Windows XP, but only after one has applied the hacks to "spoof" an XP POSReady installation and thereby enable TLS 1.1 and 1.2. See, e.g., this page: https://msfn.org/board/topic/178092-enable-tls-11-and-12-in-windows-xp-correctly/

BTW, @Remy Lebeau, Embarcadero's remote debugger also fails to work on my XP VM, which I thought likely due to its being a stripped down "nLite" XP installation. However, I have now constructed a full XP-SP3 (POSReady) VM and the remote debugger (paserver) also fails on that installation looking for a non-existent entry point in KERNEL32.dll.

Terry Peterson
  • 121
  • 1
  • 8
  • 1
    If you don't want to bother with those patches, you can switch to an OpenSSL-based networking component (e.g. Indy). – Olivier Apr 29 '20 at 20:40
  • @Olivier, but then I'd have to forgo the JSON goodies in TRESTClient that magically parse things into Client Datasets.... – Terry Peterson Apr 30 '20 at 22:59