If there's an SSL fix for RC 4, can that be implemtented in WIP?

This is where you report any issues if you are running a beta version of EventGhost
Forum rules
To submit a possible bug report please follow this template

Version: 0.5 beta 2 (the version you are running)
Traceback: Traceback (most recent call last):
File "<SOME_EVENTGHOST_FILE.py>", line 10, in <module>
SOME_FUNCTION()
File "<SOME_EVENTGHOST_FILE.py>", line 4, in SOME_EVENTGHOST_MODULE
SOME_FUNCTION()

copy and past any traceback information from the log if there is no traceback put NONE

Event:
Main.test.0.1.2.3.4.5.6.7.8
1
2

in the Event field you will want to put the event that was triggered just prior to the traceback occurring, if there is personal data put PERSONAL DATA if there was no traceback or no event triggered right before the traceback put NO EVENT

Description: if you have the ability to replicate the issue then put in here a description of what you are doing to create the problem.

Screen Shots: screen shots of the error and any events/macros/acrions that were run before the issue or screen shots of the problem

Files: any files that may be used to isolate where the issue is. something like the log.txt file would go here

if you provide the above information before hand it will greatly speed up the diagnostic process. we will not have to ask for the bits and pieces. And also having a well formatted Bug Report filled out will get answered sooner then the ones that aren't
Post Reply
Mastiff
Experienced User
Posts: 828
Joined: Thu May 03, 2012 10:43 am

If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by Mastiff » Mon Feb 05, 2018 7:24 am

I am trying to get a script for Sensibo Sky working, and it works in 0.4, but not in the latest WIP. According to Yokel22 this is an SSL problem that may have been fixed in RC4 now. But that has other and more seroius problems for me. Is it possible to get that fix into a WIP version, please?

In this thread there are some error messages that may explain what the problem is, I believe:

viewtopic.php?f=2&t=9725&start=15&sid=6 ... 316b35917f

User avatar
topix
Experienced User
Posts: 389
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by topix » Mon Feb 05, 2018 7:40 pm

I'm not 100% sure, but i vague remember that it had to do with the requests library.

What you could do is:
  • Quit EG if it's running
  • Download the attached zip-file
  • (re)move folder requests from <install-path...>\EventGhost\lib27\site-packages
  • extract the zip-file to <install-path...>\EventGhost\lib27\site-packagess
  • restart EventGhost and try if this will solve the SSL problem
Attachments
request2184_idna26.zip
(96.42 KiB) Downloaded 4 times

Mastiff
Experienced User
Posts: 828
Joined: Thu May 03, 2012 10:43 am

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by Mastiff » Mon Feb 05, 2018 8:15 pm

Thanks! I will try that tomorrow, when the system isn't in production (it controls all heat, audio and video in the house, and my renters may get annoyed if they can't turn on or off the tv...). :mrgreen:

User avatar
kgschlosser
Site Admin
Posts: 3402
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by kgschlosser » Tue Feb 06, 2018 8:16 am

the error actually has to do with the location of the CA Bundle. The fact that it can't find it.

so you will want your call to requests.get or requests.post or whatever connection method you are using that might be dealing with SSL to look like the following

Code: Select all


import requests

response = requests.get('http://SomeWebSite.com', verify=r'c:\program files (x86)\eventghost\lib27\site-packages\requests')

You can give this a try and see if it solves the problem. if it does then I will have to monkey patch the requests library to handle this. I am not sure as to why some systems are having this problem and others are not. If the above code works then I can do a simple patch to make sure the problem does not come up again.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 3402
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by kgschlosser » Tue Feb 06, 2018 8:19 am

I did find another solution that will take care of the issue without the need to do a monkey patch

Code: Select all


import os

os.environ['REQUESTS_CA_BUNDLE'] = r'c:\program files (x86)\eventghost\lib27\site-packages\requests\cacert.pem'

If you like the work I have been doing then feel free to Image

Mastiff
Experienced User
Posts: 828
Joined: Thu May 03, 2012 10:43 am

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by Mastiff » Tue Feb 06, 2018 8:29 am

Thanks! I will check it out in a couple of hours! Bus is that to be in every script that needs it, or do I put it in a py file?

User avatar
kgschlosser
Site Admin
Posts: 3402
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by kgschlosser » Tue Feb 06, 2018 8:47 am

I would use the latter of the 2 fixes. and that one you can put into a python script and drop the action into your autostart at the very top. it only has to run the once and that is when EG starts.

You can test it at any point. it does not require the restart of EG.. add the python script action copy and paste the code into the script. click the OK button.. then right click the action and click on execute. then go and try your requests connection to whatever site that was causing your problem. and see if it works.


I have already done up a fix and submitted the code to be reviewed and added to the core. If it does work if you can report back that would be a great help.

If you want to test a WIP version of EG that has this in it. it has already been built and you can download it from HERE
If you like the work I have been doing then feel free to Image

Mastiff
Experienced User
Posts: 828
Joined: Thu May 03, 2012 10:43 am

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by Mastiff » Tue Feb 06, 2018 8:50 am

OK, I did now. Put it in the startup, and ran it (without restart) and it works! :mrgreen: Thanks!

User avatar
kgschlosser
Site Admin
Posts: 3402
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by kgschlosser » Tue Feb 06, 2018 4:30 pm

YAY! so this is a working solution...

Cool beans. I will post that into the pull request on the code on github.
If you like the work I have been doing then feel free to Image

Mastiff
Experienced User
Posts: 828
Joined: Thu May 03, 2012 10:43 am

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by Mastiff » Tue Feb 06, 2018 4:31 pm

Yes, you can! :mrgreen:

User avatar
kgschlosser
Site Admin
Posts: 3402
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by kgschlosser » Tue Feb 06, 2018 4:38 pm

thank you for reviving this I got busy with things and forgot about it.
If you like the work I have been doing then feel free to Image

Mastiff
Experienced User
Posts: 828
Joined: Thu May 03, 2012 10:43 am

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by Mastiff » Tue Feb 06, 2018 4:40 pm

Hey, thank you for fixing it so quick! :mrgreen:

User avatar
kgschlosser
Site Admin
Posts: 3402
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by kgschlosser » Tue Feb 06, 2018 4:44 pm

I try to get repairs/upgrades made as fast as i can. But it sometimes takes me a while. this one has been kicking about for almost 6 months now. so i wouldn't exactly call it a speedy fix.
If you like the work I have been doing then feel free to Image

Mastiff
Experienced User
Posts: 828
Joined: Thu May 03, 2012 10:43 am

Re: If there's an SSL fix for RC 4, can that be implemtented in WIP?

Post by Mastiff » Tue Feb 06, 2018 4:47 pm

Speedy for me, I only asked yesterday! :mrgreen:

Post Reply