SReject / JSON-For-Mirc

JSON parser for mIRC
19 stars 6 forks source link

[3.0.1001] Could break on Windows 7 due TLS #59

Closed westor7 closed 3 years ago

westor7 commented 3 years ago

Hello,

I made a code for a friend, he used Win7 and tried to execute that code but $JSONError triggered in some websites, so i googled that error and found out a hotfix, so he installed that Microsoft hotfix pack and then worked, these are all the debug i having.

Example Code Usage: /html_source https://adiirc.com Error Message: an error occurred in the secure channel support

The crazy thing is that it worked on html_source https://www.youtube.com and i saw that both websites using the same encryption method (AES) but it failed only on https://adiirc.com

So i followed https://stackoverflow.com/questions/21354992/an-error-occurred-in-the-secure-channel-support-classic-asp-http-request#answer-52841060 comment and suggested him to install https://aka.ms/easyfix51044 and restart the mIRC (he used mIRC 7.64) , after that the code was working perfectly.

Code:

alias html_source {
  if (!$1) { return }

  var %v = html_ $+ $rands(1,10000000000)
  var %u = $1-

  jsonopen -Udi %v %u

  if ($jsonerror) { echo 4 -a Error: Connection error! - Error Details: $v1 | return }

  jsonhttpheader %v User-Agent Mozilla/5.0 (Windows NT 10.0 $+ $chr(59) Win64 $+ $chr(59) x64 $+ $chr(59) rv:85.0) Gecko/20100101 Firefox/85.0
  jsonhttpheader %v Accept */*
  jsonhttpheader %v Cache-Control no-cache
  jsonhttpheader %v Connection keep-alive

  var %f = $envvar(temp) $+ \source.txt

  if ($isfile(%f)) { .remove $qt(%f) }

  noop $json(%v,%f).httpbodytofile

  run $qt(%f)
}
SReject commented 3 years ago

I'll leave a note in the readme.

This isn't an issue with the script* but rather newer protocols being used that older OS don't support

SReject commented 3 years ago

Note added as of commit 5a21d1e3e65b9ede0f4130ff281574a883f8ee41