HTTPS via MSXML2.XMLHTTP

Started by JTaylor, August 19, 2015, 12:44:12 PM

Previous topic - Next topic

JTaylor

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) Select

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


td

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.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

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

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.   
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

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

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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

 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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

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

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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

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. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade