souldjer777

Trying to use _INetGetSource - Getting error 13?

8 posts in this topic

#1 ·  Posted (edited)

Good Morning AutoIT Geniuses! :sorcerer:

Now, it could be that I've been away for a while - but I can get source from just about any website except adobe using InetGetSource.

I have no idea why...  :huh2: error: 13

https://helpx.adobe.com/security.html

https://helpx.adobe.com/security.html?promoid=HRYCM

Thanks!

#include <Inet.au3>
HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko")
Local $sOpenAdobe_URLSecurityUpdates = 'https://helpx.adobe.com/security.html'
Local $OpenSSL01 = _INetGetSource($sOpenAdobe_URLSecurityUpdates)

WinHttp.au3 is returning results - I just don't get it...

Thanks! :guitar:

#include "WinHttp.au3"

Opt("MustDeclareVars", 1)

; Initialize and get session handle
Global $hOpen = _WinHttpOpen()
; Get connection handle
Global $hConnect = _WinHttpConnect($hOpen, "helpx.adobe.com")
; Make a request
Global $hRequest = _WinHttpSimpleSendRequest($hConnect, Default, "/security.html?promoid=HRYCM")

If $hRequest Then
    ; Simple-read...
    ConsoleWrite(_WinHttpSimpleReadData($hRequest) & @CRLF)
    MsgBox(64, "Okey do!", "Returned source is print to concole. Check it.")
Else
    MsgBox(48, "Error", "Error ocurred for _WinHttpSimpleSendRequest, Error number is " & @error)
EndIf

; Close handles
_WinHttpCloseHandle($hRequest)
_WinHttpCloseHandle($hConnect)
_WinHttpCloseHandle($hOpen)

 

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Did you read this:

??

And this:

https://www.autoitscript.com/forum/search/?type=all&q=inetgetsource

 

 

Edited by mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yeah, I've been all over - you try it - see if you can get it to work... I can see it in my browser - no problemo - but when I use _InetGetSource - nothing is returned and it worked fine... believe it was Feb 29 when I ran it last - why 2 weeks later does it bomb out?

Hey, I might be on to something... getting a Security Alert "certificate revocation" prompt

...

Security Alert
Revocation information for the security certificate for this site is not available. Do you want to proceed?
Yes No View Certificate
...
for some reason using the following AutoIT script...

$oHTTP = ObjCreate("Microsoft.XMLHTTP")
$oHTTP.Open("GET", "https://helpx.adobe.com/security.html", 0)
$oHTTP.Send()
Local $txt = $oHTTP.Responsetext
$oHTTP = 0
ConsoleWrite($txt)

FYI - Take from: 

That has to be it.
 

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites

I do not see any problem with this:

#include <Inet.au3>
HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko")
Local $sOpenAdobe_URLSecurityUpdates = 'https://helpx.adobe.com/security.html'
Local $OpenSSL01 = _INetGetSource($sOpenAdobe_URLSecurityUpdates)
If @error Then MsgBox($MB_ICONERROR, 'TEST', '@error = ' & @error & @CRLF & '@extended = ' & @extended)
MsgBox(0, '', $OpenSSL01)

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Gotta be my Windows updates then... or something is out of wack...

---------------------------
TEST
---------------------------
@error = 13
@extended = 12057
---------------------------
OK   
---------------------------
Everything appears to be valid... just not sure about the "revocation information".

security_alert_revocation.jpg

adobe.com_cert.jpg

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites

I'm not expert in this regard I can only confirm that on my side all is OK.

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

Me neither - thanks for testing on your end. I know for a while now Microsoft has been automating cert removal -and for good reason. I'm having trouble believing this is an Adobe thing... but it's possible - however very unlikely.

Configure Trusted Roots and Disallowed Certificates
https://technet.microsoft.com/en-us/library/dn265983.aspx?f=255&MSPPError=-2147217396


"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites

Well, as it turns out... for me this was an IE setting.

"This is a low-risk reduction in web and mail security."

Control Panel, open Internet Options. On the Advanced tab, deselect Check for server certificate revocation

Understanding Certificate Revocation Checks
https://blogs.msdn.microsoft.com/ieinternals/2011/04/07/understanding-certificate-revocation-checks/

I wouldn't expect anyone else to have to do that but that was my solution - SADLY...


"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • AndreyS
      By AndreyS
      Tell me, please, who knows why the function does not work with the specified site? _INetGetSource ("https://residence.biz.ua/")
      It is necessary to work with the protocol https. What is the problem?
    • mistersquirrle
      By mistersquirrle
      Hello!
       
      I was playing around with _INetGetSource(), and just seeing how it returned the bytes. It doesn't seem to return what I would expect, though. For example, I loaded up http://asdf.com/aboutasdf.html, and viewed the page source. Copy/ pasted that into a Notepad++ document, and I get a length of 2,481 characters > 2,481 bytes. When I do:
      #include-once #include <Inet.au3> Global $sSource, $sSite = "http://asdf.com/aboutasdf.html" Global $iBytes $sSource = _INetGetSource($sSite) ;Get the page source for the account If Not @error Then ;As long as nothing goes wrong $iBytes += @extended ;Get number of bytes returned MsgBox(0, '', $iBytes & @CRLF & $sSource) ;Number of bytes, and the source ClipPut($sSource) Exit EndIf I get a return of 2,391 bytes (missing 90 bytes) from the @extended when I run _INetGetSource(). If I put the page source into my clipboard and paste that into the Notepad++ document, I still get 2,479 (it removed the top blank line that I get when selecting all from the page source in my browser). So the source that I copy from my browser, and that AutoIt puts in my clipboard is ~2,480 bytes. So, why is the @extended returning 2,391? Maybe I'm just missing something.
      On just http://asdf.com/ it returns 1,892, which I get when copy/pasting as well, from the script and from the browser.
       
      Thanks,
    • DaLiMan
      By DaLiMan
      I'm trying to download a file from our server at work which requires a login.
      InetGet is not working so I was looking round for another method.
      I came across winhttp.au3 but it seems like this is not shipped with the Autoit ZIP I have. (v3.3.14) 
      Anyone have any ideas of where to get it, because I can't find it.
      I also searched the forum, thinking it was trancexx who made it. (maybe I'm wrong here....)
      Or is it obsolete and is there another / better way?
      Any suggestions?
       
    • souldjer777
      By souldjer777
      Good Morning All AutoIT Gurus,
       
      Does anyone know how I can get the right responses for Inet.au3 or IE.au3 for sites that check your browser, os, etc using Javascript? For some reason the source is empty using the built-in tools in AutoIT... doesn't contain the version information when reading using inetgetsource or iedocreadhtml ... The point is to find out the latest version automatically using AutoIT tools. 
      Example: https://get.adobe.com/flashplayer/
      #include <Inet.au3> $OpenHTML01 = _INetGetSource("https://get.adobe.com/flashplayer/") MsgBox (0, "", $OpenHTML01) A typical page response would include...
      "Version 18.0.0.232
      System requirements"
      ... within the <div id="autoSelectedVersion"> tag.
      Thanks!!!

      UPDATE: I believe it's this file that determines what OS, language, x32, x64, browser, etc that you are using and then reports it back...
      https://wwwimages2.adobe.com/downloadcenter/js/live/polarbear.js
       
    • AutID
      By AutID
      Hello,
      It is the second time I am running to this problem again. First time I used simple form fill function from winhttp.au3. And I added a sleep between logins to make it work but this solution sucks.
      So I am wondering again, is there an other solution to perform a log in on website other than simple form fill?
      I just want to check credentials so I need to perform log in and then check for the username in the results.
      Here is an example with simple form fill

      #include "WinHttp.au3" Global $sRead, $hOpen, $hConnect Global $sUsername, $sPassword, $sName Global $sUrl = "https://www.facebook.com/" Global $sUserAgent = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)" $hOpen = _WinHttpOpen($sUserAgent) $hConnect = _WinHttpConnect($hOpen, $sUrl) $sRead = _WinHttpSimpleFormFill($hConnect, _   Default, _   "login_form", _   "name:email", $sUsername, _   "name:pass", $sPassword) If @error Then  MsgBox(0, "Error", "Error: " & @error) ElseIf StringInStr($sRead, $sName) = True Then  MsgBox(0, "", $sName & "'s credentials are correct.") Else  MsgBox(0, "", "Wrong credentials, please try again.") EndIf _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen)