Page 1 of 1

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

Posted: Mon Feb 05, 2018 7:24 am
by Mastiff
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

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

Posted: Mon Feb 05, 2018 7:40 pm
by topix
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

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

Posted: Mon Feb 05, 2018 8:15 pm
by Mastiff
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:

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

Posted: Tue Feb 06, 2018 8:16 am
by kgschlosser
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.

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

Posted: Tue Feb 06, 2018 8:19 am
by kgschlosser
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'


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

Posted: Tue Feb 06, 2018 8:29 am
by Mastiff
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?

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

Posted: Tue Feb 06, 2018 8:47 am
by kgschlosser
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

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

Posted: Tue Feb 06, 2018 8:50 am
by Mastiff
OK, I did now. Put it in the startup, and ran it (without restart) and it works! :mrgreen: Thanks!

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

Posted: Tue Feb 06, 2018 4:30 pm
by kgschlosser
YAY! so this is a working solution...

Cool beans. I will post that into the pull request on the code on github.

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

Posted: Tue Feb 06, 2018 4:31 pm
by Mastiff
Yes, you can! :mrgreen:

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

Posted: Tue Feb 06, 2018 4:38 pm
by kgschlosser
thank you for reviving this I got busy with things and forgot about it.

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

Posted: Tue Feb 06, 2018 4:40 pm
by Mastiff
Hey, thank you for fixing it so quick! :mrgreen:

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

Posted: Tue Feb 06, 2018 4:44 pm
by kgschlosser
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.

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

Posted: Tue Feb 06, 2018 4:47 pm
by Mastiff
Speedy for me, I only asked yesterday! :mrgreen: