Author Topic: HTTPS via MSXML2.XMLHTTP  (Read 3113 times)

JTaylor

  • Pundit
  • *****
  • Posts: 743
    • Data & Stuff Inc.
HTTPS via MSXML2.XMLHTTP
« on: August 19, 2015, 12:44:12 pm »
The following code works as a WinBatch Script with HTTP and HTTPS and it works with WebBatch if I use HTTP but not HTTPS.   Is this expected behavior?

I get a response of:

1261:  COM/CLR: Exception

MSXMLHTTP.Send

Jim

Code: Winbatch
    MSXMLHTTP = CreateObject("MSXML2.XMLHTTP.6.0")
    MSXMLHTTP.Open("GET", XMLURL, @FALSE)
    MSXMLHTTP.Send
    xtxt = MSXMLHTTP.ResponseText
    ObjectClose(MSXMLHTTP)

 

td

  • Tech Support
  • *****
  • Posts: 2113
    • WinBatch
Re: HTTPS via MSXML2.XMLHTTP
« Reply #1 on: August 19, 2015, 01:09:30 pm »
Can't offer much constructive help nor whether or not it is expected.  But if you are using the same version of both products then you are using exactly the same interpreter in both cases.  This would lead one to believe that the difference in behavior is environmental.   Don't know what that difference might be but you could consider some of the usual suspects like the account running the script, etc.

"le succès est une terrible maîtresse"
(French translation), Bill Gates


JTaylor

  • Pundit
  • *****
  • Posts: 743
    • Data & Stuff Inc.
Re: HTTPS via MSXML2.XMLHTTP
« Reply #2 on: August 19, 2015, 03:09:25 pm »
Do you have an easy way to test this on WebBatch if I send you a URL directly?  I'm not sure what else to check.  I would think if it were an account issue that it would be blocking on the Object creation as opposed to the Send but you know far more than I.   Not sure what I would change on the account to affect such a thing.

Jim

td

  • Tech Support
  • *****
  • Posts: 2113
    • WinBatch
Re: HTTPS via MSXML2.XMLHTTP
« Reply #3 on: August 20, 2015, 07:25:46 am »
Don't see why object creation would be blocked simply because of of the objects method's encounters some kind of security issue. 

Presumably, you are dealing with a Web server not of your own creation and you may simply be bumping up against some built in protocol blocking used to prevent  server side exploits or something.  The server wouldn't care about COM objects but might flag simultaneously mixing  open and secured ports on a single worker thread.   Again, this notion is pure speculation on my part and there may be obvious counter examples that show this to not be the case but you might consider searching for information centered around the internals of your Web server software.   
"le succès est une terrible maîtresse"
(French translation), Bill Gates


JTaylor

  • Pundit
  • *****
  • Posts: 743
    • Data & Stuff Inc.
Re: HTTPS via MSXML2.XMLHTTP
« Reply #4 on: August 20, 2015, 08:00:03 am »
I have been searching for hours and is why I posted the question since I was going nowhere.   Probably is security related but not sure what to do to fix it.   The certificate on my server is good but not sure how much that comes into play.  I have no control over the other server.    Of course, my ignorance about what MSXMLHTTP is doing with such thing as SSL vs TLS doesn't help.   Not sure if that is coming into play or not and if making sure SSL is disabled on my server would make a difference or not.  Oh well, thought I would ask and hope for the best.

Jim

td

  • Tech Support
  • *****
  • Posts: 2113
    • WinBatch
Re: HTTPS via MSXML2.XMLHTTP
« Reply #5 on: August 20, 2015, 08:45:12 am »
Sometimes reframing the problem can lead to search terms that in turn lead to a solution.  That is the reason for the suggestion that you search based on your Web server's particulars.  Based on your original post it is was not clear that you had or had not considered the web server security perspective.
"le succès est une terrible maîtresse"
(French translation), Bill Gates


td

  • Tech Support
  • *****
  • Posts: 2113
    • WinBatch
Re: HTTPS via MSXML2.XMLHTTP
« Reply #6 on: August 21, 2015, 07:14:30 am »
 You may want to consider switching from 'MSXML2.XMLHTTP.6.0' to 'Msxml2.ServerXMLHTTP.6.0'. Have not idea if this would resolve your issue but MSFT does recommend the later over the former for server side implementations.
"le succès est une terrible maîtresse"
(French translation), Bill Gates


JTaylor

  • Pundit
  • *****
  • Posts: 743
    • Data & Stuff Inc.
Re: HTTPS via MSXML2.XMLHTTP
« Reply #7 on: August 21, 2015, 07:43:50 am »
Yes.  Had already tried that as someone mentioned it fixed their problem but no luck.  I found a tool for turning off various security protocols and turned off SSL 2...3 was already off.  Need to reboot my server and see if that makes a difference but have to wait for a quiet moment.  Thanks for the follow-up though.

Jim

td

  • Tech Support
  • *****
  • Posts: 2113
    • WinBatch
Re: HTTPS via MSXML2.XMLHTTP
« Reply #8 on: August 21, 2015, 10:42:29 am »
Went through a similar exercise after I returned from a vacation this week.  Our secure server was down to one functioning RAID array so we built a new server using the latest version of Windows Server.  Out of the box the OS had just about every imaginable SSL protocol and encryption algorithm enabled.
"le succès est une terrible maîtresse"
(French translation), Bill Gates


td

  • Tech Support
  • *****
  • Posts: 2113
    • WinBatch
Re: HTTPS via MSXML2.XMLHTTP
« Reply #9 on: August 21, 2015, 02:54:09 pm »
Took a few spare moments to play with various combinations of secured and unsecured Websites and server using your code snippet and could not reproduce your problem.   The testing was performed using the latest version of WebBatch running on Windows 2012 R2 and IIS 8.5. 
"le succès est une terrible maîtresse"
(French translation), Bill Gates