HTTP OK, HTTPS with 1101 error

Hi Guys

API request with HTTP works fine. (button1 and button2)
API request with HTTPS results in error 1101. (button3 and button4)
When I use the same HTTPS request on the browser it works.

Any Tips?

image

Do you really need https over a local network ?

Can you test https with a url on the web instead of your LAN ?
Is it just this API call or any https request ?

Hello!
This is on the LAN for test purposes.
Another URL works fine (https://google.com)
Is this request:

https://192.168.0.6/api/?type=user-id&cmd=1.0updatedyngrp_test&key=LUFRPT1tdnJQL3YyTTJmTWcxZmlVa3ZIeDRlN1k5eEE9WHZCbzltbWVyRUFWdnhGdzYycWluWWxZa2VicXcyTllEL0YwcUdmdXI3alRDVjV5WEtyMnFPK1o3Q1QzVjNJbw==

and you say that:

http://192.168.0.6/api/?type=user-id&cmd=1.0updatedyngrp_test&key=LUFRPT1tdnJQL3YyTTJmTWcxZmlVa3ZIeDRlN1k5eEE9WHZCbzltbWVyRUFWdnhGdzYycWluWWxZa2VicXcyTllEL0YwcUdmdXI3alRDVjV5WEtyMnFPK1o3Q1QzVjNJbw==

works OK. Are you sure you are serving https on your lan ?

This same HTTPS request with a browser on the same Android device works well. So the HTTPS is ok.

What happens if you put that url in a webviewer ?

You could:

Try with PostText / PutText instead of GET ?

Put all your parameters in the postText block (no ? needed), so just the “http://192.168.0.6/api/” in the web1.url

In the web viewer it works, in Inventor not.

See Blocks for POST and PUT

Results for Post:

Results for Put:

By webviewer I mean the webviewer component in AppInventor 2, not your device browser (Chrome/Firefox/Opera)

With Webviewer getting the following error:

Aha - looks like AppInventor is not connecting over SSL locally.

Try ticking the SSL errors checkbox for the webviewer ?

Unfortunately support for self-signed SSL certificates in the Web component is still an open issue:

I have same problem last month, and i solved using google apps script with fetch url, so i put https in google apps script to fetch the url,and its works fine…as long the self-signed SSL certificates in the Web component isnstill an open issue, i think this is my best solutions for now

Is there anyway to resolve this issue around SSL and self signed certificate ? Is there a sample that we can use to add the self signed certificates or set the value for "ignoreSSLError"

Hello everybody, i have the same issue using an Rest/Json API on mi Website with an self signed certificate, in the webviewer with the Flag "ignore ssl errors" is set it works fine. But in the web extension i can`t get an connection, is there a solution for my Problem? Thank you.

I presume you mean the web component ?

With regard to your problem, we will just have to guess, given that you have not shown us anything....

What is the responseContent coming back from your web GET ?
Does it work with http, or https, or neither ?

Sorry, yes i mean the web component.
Here the Blocks of my test Projekt:

username,password and url are anonymized in the picture, on my Server i use a self signed ssl certificate.
On Button 1 i get Error 1101: Unable to get a response with the specified URL: https://myusername:mypassword@myurl.de/rest/devices.
On Button 2 i get Error 1101: Unable to get a response with the specified URL: https://myurl.de/rest/devices
this is plausible to me, it could not work.
On Button 3 i get the right resposne in the Webviewer like this:


Thank you for your help!

So, what is the problem with using "Button3" ?

You could always "scrape" the returned data:

1 Like

When this issue came up previously we had some back and forth internally about how to handle it but it was never fully resolved. I originally had implemented a draft of an IgnoreSslError flag similar to what the WebViewer provides, but the only reason we did that for WebViewer was due to the fact that it wasn't possible to specify alternative root certificates. With the Web component, we do have the option of providing our own validation so the alternative proposed approach was to allow people to specify a custom root certificate to handle situations where servers were providing self signed certificates.

If your server is on the public internet and has a domain name, your best option would be to use LetsEncrypt to get a valid certificate and therefore is the lowest effort solution.

Great thanks to @TIMAI2 and @ewpatton you helped me so much! Now i can work further. I read the json with the webviewer an set it as invisible so i can put its parameters into Variables.