Announcement

Collapse
No announcement yet.

hs.geturl ssl issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • hs.geturl ssl issue

    Hi all,

    i was trying something but how exactly can i get an url with ssl?
    other sites work normal,

    ERROR: The request was aborted: Could not create SSL/TLS secure channel.


    this is a very small bit of my code that throws the error i did simplify it,

    Code:
    Sub Main(ByVal Parms As Object)
    Dim strSite = "http://carbu.com
                        'Dim strDocument =  "/belgie//index.php/station/gabriels/lanaken/3620/20495"
                        Dim strDocument =  ""
                        dim test as string
                        dim x as string
    
                        test = hs.GetUrl(strSite,strDocument,false,80)
    
    
    
                            hs.writelog("test",Test)
    
    
                        end sub

    regards
    Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
    Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




    HS3Pro 3.0.0.531 on windows 7 ultimate X64 on hp quadcore laptop 8 GB.

  • #2
    It's probably related to SSL/TLS support in .NET 4. For instance .NET 4 only supports TLS 1.0 whereas many sites now have switched to TLS 1.2 or higher. No easy way around that without compiling HS3 in a later version of .NET. As you are on Windows, you can use hs.GetURLIE which provides the certificate support via Internet Explorer.
    Jon

    Comment


    • #3
      Originally posted by jon00 View Post
      It's probably related to SSL/TLS support in .NET 4. For instance .NET 4 only supports TLS 1.0 whereas many sites now have switched to TLS 1.2 or higher. No easy way around that without compiling HS3 in a later version of .NET. As you are on Windows, you can use hs.GetURLIE which provides the certificate support via Internet Explorer.
      hi jon,

      thanks for the reply, i did try it but get this error :

      Exception has been thrown by the target of an invocation.Overload resolution failed because no accessible 'GetURLIE' accepts this number of arguments.
      Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
      Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




      HS3Pro 3.0.0.531 on windows 7 ultimate X64 on hp quadcore laptop 8 GB.

      Comment


      • #4
        It only has two parameters. Checkout: http://help.homeseer.com/help/HS3/st...ernet_geturlie
        Jon

        Comment


        • #5
          Maybe you should change the url you are using in your script from
          "http://carbu.com" to "https://carbu.com"

          Comment


          • #6
            Add this to your script before the hs.geturl line:

            Code:
                    System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
            HS 3.0.0.548: 1976 Devices 1156 Events
            Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

            Comment


            • #7
              Originally posted by sparkman View Post
              Add this to your script before the hs.geturl line:

              Code:
               System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
              Does that work? I'm sure I read somewhere it was on valid with C#?
              Jon

              Comment


              • #8
                Originally posted by jon00 View Post

                Does that work? I'm sure I read somewhere it was on valid with C#?
                Yes, I use it in quite a few vb.net scripts.
                HS 3.0.0.548: 1976 Devices 1156 Events
                Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                Comment


                • #9
                  Originally posted by sparkman View Post

                  Yes, I use it in quite a few vb.net scripts.
                  Difference of opinion on Stackoverflow..... https://stackoverflow.com/questions/...k-4-0/39725273
                  Jon

                  Comment


                  • #10
                    Originally posted by jon00 View Post

                    Difference of opinion on Stackoverflow..... https://stackoverflow.com/questions/...k-4-0/39725273
                    I don't put much faith in Stackoverflow as the knowledge level of people varies wildly. I have working vb.net scripts in HS that don't throw an error with that line and it allowed me to access webpages that no longer support TLS 1.0 (i.e my scripts do not work without that line).
                    HS 3.0.0.548: 1976 Devices 1156 Events
                    Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                    Comment


                    • #11
                      +1 on Al's suggestion. Simple fix works here as well.
                      If that format doesn't work out, try:
                      ServicePointManager.SecurityProtocol = 48 or 192 or 768 or 3072 ' Note: SSL3 = 48 TLS = 192 TLS11 = 768 TLS12 = 3072

                      Real courage is not securing your Wi-Fi network.

                      Comment


                      • #12
                        thank you all for your reply,

                        but its kind of sad u need to use hs.geturlie.. it takes for me 20 seconds to return the data..
                        or im doing something wrong here

                        i already use jon00 scraper but i have to many scrapes at once running, so i wanted to build another script that runs a different time a day

                        like it opens 2x the site for 2 objects..
                        i did it like this, i simplify this code for myself and it works really well.

                        Code:
                        Dim strSite = "https://carbu.com/belgie/index.php/station/gabriels/lanaken/3620/20495"
                        
                        System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
                        e5 = hs.GetURLIE(strSite,false)
                        e10 = hs.GetURLIE(strSite,false)
                        
                        x = Instr(1,e5,"panel-heading",+ 8)
                                            e5 = Mid(e5,x)
                                            x = Instr(1,e5, "Super 98 (E5)",1) +1
                                            e5 = Mid(e5,x)
                                            x = Instr(1,e5, "price",1) +1
                                            e5 = Mid(e5,x)
                                            x = Instr(1,e5, ">",1) +1
                                            e5 = Mid(e5,x)
                                            x = Instr(1,e5, "</h1",1) -1
                                            e5 = Mid(e5,1,x)
                        
                        hs.writelog("e5",e5)
                        
                        
                        x2 = Instr(1,e10,"panel-heading",+ 8)
                                            e10 = Mid(e10,x2)
                                            x2 = Instr(1,e10, "Super 95 (E10)",1) +1
                                            e10 = Mid(e10,x2)
                                            x2 = Instr(1,e10, "price",1) +1
                                            e10 = Mid(e10,x2)
                                            x2 = Instr(1,e10, ">",1) +1
                                            e10 = Mid(e10,x2)
                                            x2 = Instr(1,e10, "</h1",1) -1
                                            e10 = Mid(e10,1,x2)
                        
                                                hs.writelog("e5",e10)
                        Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
                        Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




                        HS3Pro 3.0.0.531 on windows 7 ultimate X64 on hp quadcore laptop 8 GB.

                        Comment


                        • #13
                          Why not open the site just once?

                          e5 = hs.GetURLIE(strSite,false)
                          e10 = e5
                          . . .
                          Real courage is not securing your Wi-Fi network.

                          Comment


                          • #14
                            Originally posted by Wadenut View Post
                            Why not open the site just once?

                            e5 = hs.GetURLIE(strSite,false)
                            e10 = e5
                            . . .
                            yes that works. thank you
                            how could i forget that, wow
                            Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
                            Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




                            HS3Pro 3.0.0.531 on windows 7 ultimate X64 on hp quadcore laptop 8 GB.

                            Comment


                            • #15
                              Originally posted by Malosa View Post

                              i already use jon00 scraper but i have to many scrapes at once running, so i wanted to build another script that runs a different time a day
                              FYI, you can run individual/selection of scrapes using the script parameter entry. i.e.

                              Sub or Function: Main
                              Parameters: 5+7

                              This would just get scrapes from Grab 5 and Grab 7
                              Jon

                              Comment

                              Working...
                              X