https call blocked?

Jake4691

New member
Hi,

I'm prettty new to this community and only recently started to work with Macrodroid.

I'm now using a Geofence trigger to instruct my Domoticz instance to set a switch to on or off. I'm using this action URL:
https://178.84.***:****/json.htm?username=****&password=****&type=command&param=switchlight&idx=312&switchcmd=Off
I've checked the "HTTP GET (No webbrowser)" tag, rest is unchecked.

When the trigger is fired I see the following response in the Macrodroid system log:
systemlog.jpg

Dropping the same URL in a browser on the same mobile device does set the switch to On or Off in Domoticz without problems.
What am I doing wrong here?
 
Last edited:

Jake4691

New member
hmm .. seems related to https, is it supported ? and with what certificates ?
Not sure, but when I choose the "URL encode parameters" instead of the "HTTP GET (No web browser)" and fire the trigger, the weblink works just fine and the switch has changed to the Off position.
 

tanutanu

Well-known member
Not sure, but when I choose the "URL encode parameters" instead of the "HTTP GET (No web browser)" and fire the trigger, the weblink works just fine and the switch has changed to the Off position.
Does the GET string contain "URL safe" characters only? If the username and/or password contains illegal characters, the difference of trials might be reasonable. Some are often hidden in multibyte characters.
 

Jake4691

New member
Does the GET string contain "URL safe" characters only? If the username and/or password contains illegal characters, the difference of trials might be reasonable. Some are often hidden in multibyte characters.
Good thinking, but username & password do not contain any illegal characters, just [a-Z,0-9,=].
Furthermore, when I enable username/password check in my Domoticz software for local network and iso https://178.84.***.***:***** use http://192.168.178.20:3339 in the URL, the Macrodroid action fires without error and the switch is set to Off.
Rest of the URL did not change.
 

dsnz

Well-known member
Not sure, but when I choose the "URL encode parameters" instead of the "HTTP GET (No web browser)" and fire the trigger, the weblink works just fine and the switch has changed to the Off position.
the url encode must be unrelated, should have same behavior whether you choose it or not
but I don't know what http get (no web browser) is doing , I guess it just sends the first GET and that's it, no redirection , no other http/https handshakes or protocol exchanges with the other side and this may not be appropriate with your Domoticz softwareb(@MacroDroidDev could explain the difference ?)

but as you say you have the solution , just untick the http GET only option and it works for you 😂
 

tanutanu

Well-known member
Good thinking, but username & password do not contain any illegal characters, just [a-Z,0-9,=].
Furthermore, when I enable username/password check in my Domoticz software for local network and iso https://178.84.***.***:***** use http://192.168.178.20:3339 in the URL, the Macrodroid action fires without error and the switch is set to Off.
Rest of the URL did not change.
So, the difference between your default browser and MD internal HTTP GET action might be possibility/ability to refer the OS certificate store, or stored certificate itself.
Do you open the site https://178.84.xxx.xxx/ with your standard browser and check the certificate?
If the browser shows you such a security alert like attached image, you might have to install a user defined certificate distributed by the site service provider. If not, MD action might not support https protocol. Try another plugin such as curl command on Termux, RESTalk for tasker or HTTP Request Shortcuts. The thread might help you if you encountered issues when trying alternatives.

If you don't need any return value such as typical JSON data structure, I agree with dsnz.
 

Attachments

  • Screenshot_20210928-060926~2_copy_1080x884.png
    Screenshot_20210928-060926~2_copy_1080x884.png
    57.1 KB · Views: 3

Jake4691

New member
Thank you all for your comments and help. I've decided to bypass the issue for now by using the app "HTTP Shortcuts" (https://http-shortcuts.rmy.ch/), which will now be called as macro action from MD by means of: Actions > Applications > Launch Shortcut. Here one can choose "HTTP Shortcuts" and from the list of prepared shortcuts in "HTTP Shortcuts" one can select the appropriate item.

In the "HTTP Shortcuts" app, where I defined the URL as a shortcut, there is an option per shortcut to accept any certificate. You'll find it when editting your shortcut under "Advanced Technical Settings" which forces it to accept any certificate. Don't know if this option is available in MD itself. If not, maybe it would be a nice to have for future releases of MD. ;-)
 
Last edited:

MacroDroidDev

Administrator
Staff member
I just checked the action as I thought I had previously added an option to accept any HTTP certificate, but it's clearly not there. So if I did add it then it never made it into the main code branch, or maybe I'm just remembering that I meant to add it!

Either way I will stick it on the TODO list to add this soon. I think it should be quite straightforward (but not 100% sure without delving further).
 

Jake4691

New member
I just checked the action as I thought I had previously added an option to accept any HTTP certificate, but it's clearly not there. So if I did add it then it never made it into the main code branch, or maybe I'm just remembering that I meant to add it!

Either way I will stick it on the TODO list to add this soon. I think it should be quite straightforward (but not 100% sure without delving further).
Glad to hear. That would be nice. Be looking forward to the implementation. ;-)
 

Jacob L

Moderator (Lawsonator)
just curious ... can you indicate when the next update is planned to be released?
There are some serious changes coming, to fix things that Google broke and the addition of new features and an SDK change so it could be a while.
 

MacroDroidDev

Administrator
Staff member
@Jake4691 I anticipate the first beta in the next few days. I'm going have some fun with this release I expect as the forced target SDK change will likely cause problems, therefore I expect a full release will be at best a couple of weeks later.
 

Jake4691

New member
@Jake4691 I anticipate the first beta in the next few days. I'm going have some fun with this release I expect as the forced target SDK change will likely cause problems, therefore I expect a full release will be at best a couple of weeks later.
@MacroDroidDev: really appreciate you're taking the time and effort to inform me about this! Looking forward to the new release.
Keep up the good work.
 

Jake4691

New member
@Jake4691 I anticipate the first beta in the next few days. I'm going have some fun with this release I expect as the forced target SDK change will likely cause problems, therefore I expect a full release will be at best a couple of weeks later.
I recently entered the beta-track and downloaded the latest version, however, the issue does not seem to be solved. I'm still experiencing the same error. I'm currently working with version 5.19.11.
 
Last edited:
Top