Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

Posted (edited)

The update includes https, but it's not clear if it means we can access web sites using https connection

For example follow commands don't work anymore 

api.get("/proxy?url=http://127.0.0.1:80/services/system/ledStatus.php")  

returns null

and

http=net.HTTPClient({timeout=7000});
http:request("http://user:password@HC-IP/services/system/ledStatus.php",
  { option = {method = "GET"},
    success = function(resp) 
   print(json.encode(resp))
    end,
  error = function(error) fibaro:debug("<font color=orangered> [X] "..error.."</font>"end
 })
returns error 401

and 

http=net.HTTPClient({timeout=7000});
http:request("http:/user:password@HC-IP/api/devices",
  { option = {method = "GET"},
    success = function(resp) 
   print(json.encode(resp))
    end,
  error = function(error) fibaro:debug("<font color=orangered> [X] "..error.."</font>"end
 })
returns error 401

but very strange that the follow command does work!

http=net.HTTPClient({timeout=7000});
http:request("http:/user:password@HC-IP/api/settings/info",
  { option = {method = "GET"},
    success = function(resp) 
   print(json.encode(resp))
    end,
  error = function(error) fibaro:debug("<font color=orangered> [X] "..error.."</font>"end
 })

 

in addition https web site returns an error

Please login or register to see this spoiler.

 

Is anyone has succeed to access https web sites?

Edited by cag014
Posted (edited)
12 hours ago, cag014 said:

The update includes https, but it's not clear if it means we can access web sites using https connection

For example follow commands don't work anymore 

api.get("/proxy?url=http://127.0.0.1:80/services/system/ledStatus.php")  

returns null

and

http=net.HTTPClient({timeout=7000});
http:request("http://user:password@HC-IP/services/system/ledStatus.php",
  { option = {method = "GET"},
    success = function(resp) 
   print(json.encode(resp))
    end,
  error = function(error) fibaro:debug("<font color=orangered> [X] "..error.."</font>"end
 })
returns error 401

and 

http=net.HTTPClient({timeout=7000});
http:request("http:/user:password@HC-IP/api/devices",
  { option = {method = "GET"},
    success = function(resp) 
   print(json.encode(resp))
    end,
  error = function(error) fibaro:debug("<font color=orangered> [X] "..error.."</font>"end
 })
returns error 401

but very strange that the follow command does work!

http=net.HTTPClient({timeout=7000});
http:request("http:/user:password@HC-IP/api/settings/info",
  { option = {method = "GET"},
    success = function(resp) 
   print(json.encode(resp))
    end,
  error = function(error) fibaro:debug("<font color=orangered> [X] "..error.."</font>"end
 })

 

in addition https web site returns an error

Please login or register to see this spoiler.

 

Edited by ChristianSogaard
P
  • Topic Author
  • Posted

    Another observation, while using same code 

    Please login or register to see this code.

    HC3 returns valid response 

    HC2 returns an error

    [DEBUG] 00:00:13: 2022-05-03 00:00:13.340730 [ error] Handshake error: certificate verify failed

    [DEBUG] 00:00:13: [X] certificate verify failed

  • Topic Author
  • Posted
    11 hours ago, ChristianSogaard said:

     

    ????

    • cag014 changed the title to HTTPS and API don't work

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...