Refreshing Image URL with https/SSL and self-signed cert

Posted on
Sun Jan 13, 2019 2:12 pm
ZachBenz offline
Posts: 163
Joined: Feb 08, 2014

Refreshing Image URL with https/SSL and self-signed cert

Hi all,

I have a control page set up with a Refreshing Image URL pointing to a continuously refreshing image from a SecuritySpy camera, with SecuritySpy set up to serve a web interface - port 8001 for HTTP, and 8002 for HTTPS

e.g, the URL is something like:
http://username:password@127.0.0.1:8001 ... t=1080&401

With the refresh rate set to Continuous and the Image Size set to 1920x1080.

And this works great.

Now, if I instead use an https connection:
https://username:password@127.0.0.1:800 ... t=1080&401

I see errors in the Indigo log:
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>

The problem being that SecuritySpy uses a self-signed certificate.

I don't see an obvious way to either disable the certificate check for the Refreshing Image URL or to permanently add the self-signed certificate as trusted (it is already trusted at the system level via the macOS Keychain, but that trust chain doesn't appear to be used by Indigo). Is there a way to do either? I'd like to only run the SecuritySpy HTTPS server, and disable the HTTP one.

ZachBenz's Plugins: RingForIndigo

Posted on
Thu Aug 13, 2020 2:26 pm
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Refreshing Image URL with https/SSL and self-signed cert

Looks like I'm not the first person with this problem. But no answers.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Mon Aug 24, 2020 10:06 am
jroach offline
Posts: 254
Joined: Oct 29, 2010

Re: Refreshing Image URL with https/SSL and self-signed cert

I'm new to this and run the risk of replying with something obvious or stupid but WTH.

There is some info on certs and SS here:

https://www.bensoftware.com/securityspy/helpfaq.html

If the plugin-in didn't consider some security changes that might have been made along the way... maybe this is the smoking gun:

https://medium.com/@moreless/how-to-fix ... 772d9dd14c

Posted on
Tue Aug 25, 2020 5:15 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Refreshing Image URL with https/SSL and self-signed cert

If you are up for trying to hack in a change to have Indigo skip cert validation, then open the file /Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoWebServer/indigopy/indigoreqhandler.py in a raw text editor (TextWrangler, BBEdit, etc.) and:

around line 42, after:

Code: Select all
import socket

add:

Code: Select all
import ssl

and around line 455 replace line:

Code: Select all
                  result = urllib2.urlopen(imageReq)

with:

Code: Select all
                  result = urllib2.urlopen(imageReq, context=ssl._create_unverified_context())

I recommend making a backup of the file before your change, and if the change works makes a backup of the changed file. Future versions of the Indigo installer might overwrite your change. Be sure and stop and restart the Indigo Server before testing, and let me know if it works.

Image

Posted on
Wed Nov 29, 2023 11:46 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Refreshing Image URL with https/SSL and self-signed cert

Code: Select all
   Web Server                      https://api.buienradar.nl/image/1.0/RadarMapNL?w=160&h=120
load error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>


How can we fix this error with Indigo 2022 or higher?

Because that file (IndigoWebServer/indigopy/indigoreqhandler.py) doesn't exist anymore..

Thanks for the hint.

John

Posted on
Wed Nov 29, 2023 4:47 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Refreshing Image URL with https/SSL and self-signed cert

McJohn wrote:
Code: Select all
   Web Server                      https://api.buienradar.nl/image/1.0/RadarMapNL?w=160&h=120
load error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>


This was fixed in 2023.1 (yes, I know you are having other issues with 2023.1, but this problem at least is fixed).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Nov 30, 2023 3:18 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Refreshing Image URL with https/SSL and self-signed cert

This is the error with Indigo 2023.1.1 with the same URL:

Web Server Error /web/refreshingimage: no refreshing image URL configured for element 323 on page ''
Web Server Warning HTTP 400 error for request /web/refreshingimage

Posted on
Thu Nov 30, 2023 9:42 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Refreshing Image URL with https/SSL and self-signed cert

That appears to be an unrelated issue - are you sure that you don't have a refreshing image on that particular page that isn't configured correctly?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Nov 30, 2023 10:05 am
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Refreshing Image URL with https/SSL and self-signed cert

It was working perfectly for years.

It's only that Refreshing URL:

https://api.buienradar.nl/image/1.0/Rad ... =160&h=120

Refresh rate 30 sec.
Image size 160 x 120

You can try it by yourself and see what happens.

Posted on
Thu Nov 30, 2023 11:16 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Refreshing Image URL with https/SSL and self-signed cert

It is unrelated to the SSL issue, which is what this topic is about.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Nov 30, 2023 12:02 pm
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Refreshing Image URL with https/SSL and self-signed cert

OK, and more important:

What's the solution?

Posted on
Thu Nov 30, 2023 12:08 pm
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Refreshing Image URL with https/SSL and self-signed cert

PS; topic says:
"Refreshing Image URL with https/SSL and self-signed cert"

Error in Indigo 2022 says (wit this Refreshing Image URL) :
"<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>

Do we have add another topic for this to get a solution?

Posted on
Thu Nov 30, 2023 12:24 pm
FlyingDiver offline
User avatar
Posts: 7217
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Refreshing Image URL with https/SSL and self-signed cert

McJohn wrote:
PS; topic says:
"Refreshing Image URL with https/SSL and self-signed cert"

Error in Indigo 2022 says (wit this Refreshing Image URL) :
"<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>

Do we have add another topic for this to get a solution?


You should start a NEW thread for your NEW issue which only happens on 2023.1.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Nov 30, 2023 12:31 pm
McJohn offline
User avatar
Posts: 631
Joined: Dec 18, 2012
Location: The Netherlands

Re: Refreshing Image URL with https/SSL and self-signed cert

OK, no problem if that gives a solution...

(But our original question was about this problem in Indigo 2022. NOT in Indigo 2023 and the subject of this thread doesn't say a difference between 2022 and 2023)

Sorry that we don't have made a new thread for the same URL in Indigo 2023....

Posted on
Thu Nov 30, 2023 12:43 pm
FlyingDiver offline
User avatar
Posts: 7217
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Refreshing Image URL with https/SSL and self-signed cert

McJohn wrote:
Sorry that we don't have made a new thread for the same URL in Indigo 2023....


It may be the same URL but it is NOT the same problem. The error messages are totally different.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Who is online

Users browsing this forum: No registered users and 9 guests