Author Topic: Base Canada updates  (Read 357 times)

0 Members and 1 Guest are viewing this topic.

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 3910
    • KomokaWeather
Base Canada updates
« on: November 13, 2017, 05:01:03 PM »
Just updated some scripts since my previous update of Oct 11/17, including ec-lightning. 
If I run http://www.komokaweather.com/komokaweather-ca/wxeclightning.php shows many it is full of "Warnings...."

Anything I may have done wrong?

Paul

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6534
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Base Canada updates
« Reply #1 on: November 13, 2017, 05:18:30 PM »
The messages
Quote
Warning: fopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /home/content/96/5379896/html/komokaweather-ca/ec-lightning.php on line 834

Warning: fopen(): Failed to enable crypto in /home/content/96/5379896/html/komokaweather-ca/ec-lightning.php on line 834

Warning: fopen(https://weather.gc.ca/data/lightning_images/ONT_201711132100.png): failed to open stream: operation failed in /home/content/96/5379896/html/komokaweather-ca/ec-lightning.php on line 834

Warning: imagecreatefrompng(): './radar/lightning-ONT-0-large.png' is not a valid PNG file in /home/content/96/5379896/html/komokaweather-ca/ec-lightning.php on line 784

indicate a PHP setup issue with streams for https even though it says (check-fetch-times.php?show=versions)
Quote
Website PHP information

Webserver OS: Linux p3nlhg779.shr.prod.phx3.secureserver.net 2.6.32-604.30.3.lve1.3.63.el6.nfsfixes.x86_64 #1 SMP Mon Oct 26 11:56:49 MST 2015 x86_64
PHP Version: 5.6.27
Document root: /var/chroot/home/content/96/5379896/html
allow_url_fopen = ON
allow_url_include = off
Stream support for http is available
Stream support for https is available
that https is available via stream support.

The code used (last line is 834)
Code: [Select]
  $opts = array(
    'http'=>array(
    'method'=>"GET",
    'protocol_version' => 1.1,
    'header'=>"Cache-Control: no-cache, must-revalidate\r\n" .
            "Cache-control: max-age=0\r\n" .
            "Connection: close\r\n" .
            "User-agent: Mozilla/5.0 (ec-lightning.php saratoga-weather.org)\r\n"
    ),
    'https'=>array(
    'method'=>"GET",
    'protocol_version' => 1.1,
    'header'=>"Cache-Control: no-cache, must-revalidate\r\n" .
            "Cache-control: max-age=0\r\n" .
            "Connection: close\r\n" .
            "User-agent: Mozilla/5.0 (ec-lightning.php saratoga-weather.org)\r\n"
)
  );

  $context = stream_context_create($opts);

  $rh = fopen($file_source, 'rb',false,$context);
show a proper context is issued.  Have the tech support for your hoster validate the proper PHP setup for https -- looks like the operative failure is
Quote
fopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
for them to address.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6534
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Base Canada updates
« Reply #2 on: November 13, 2017, 05:30:07 PM »
If the tech support call doesn't resolve the issue, try changing
Code: [Select]
  $opts = array(
    'http'=>array(
to
Code: [Select]
  $opts = array(
    "ssl" => array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
    'http'=>array(
which causes it to behave as the curl settings do for curl access.  On GoDaddy, it may just be required due to their inability to verify certs...
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 3910
    • KomokaWeather
Re: Base Canada updates
« Reply #3 on: November 13, 2017, 06:05:02 PM »
Hi Ken,
I was talking to GoDaddy support about my PHP version issue before your reply came through so did not talk about this ec-lightning issue yet.  Before I call them on this:
1. I don't have secure hosting as yet with GoDaddy.  Does that make a difference?
2. My previous PHP issue that showed v 5.2.17 instead of v5.6.27 in my /weather folder was apparently due to some code in my .htaccess file in the /weather folder that they say did some redirect.  They temporarily renamed it during my support call and then shows correct PHP v 5.6.27.  I have now replaced the /weather .htaccess with similar to what I have in my /komokaweather-ca (Saratoga) folder and which you had kindly provided in the past.  I presume no relation between that PHP version issue, and the ec_lightning issue which is in a different folder and which had no issue with the PHP version?

Thanks for your updates and your efforts to follow up on this.

Regards,
Paul

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6534
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Base Canada updates
« Reply #4 on: November 13, 2017, 07:29:05 PM »
Hi Ken,
I was talking to GoDaddy support about my PHP version issue before your reply came through so did not talk about this ec-lightning issue yet.  Before I call them on this:
1. I don't have secure hosting as yet with GoDaddy.  Does that make a difference?

Shouldn't make any difference.  This is an internal PHP/OpenSSL setup issue on their server that it can't do verify on peers/hosts


2. My previous PHP issue that showed v 5.2.17 instead of v5.6.27 in my /weather folder was apparently due to some code in my .htaccess file in the /weather folder that they say did some redirect.  They temporarily renamed it during my support call and then shows correct PHP v 5.6.27.  I have now replaced the /weather .htaccess with similar to what I have in my /komokaweather-ca (Saratoga) folder and which you had kindly provided in the past.  I presume no relation between that PHP version issue, and the ec_lightning issue which is in a different folder and which had no issue with the PHP version?

Thanks for your updates and your efforts to follow up on this.

Regards,
Paul

PHP 5.2.17 is ancient and likely had issues fixed by PHP 5.6 .. best to run the most current available version on your site(s).

I'd still suggest the addenda of the ssl options I'd cited above.. it can likely bypass the issue on your current GoDaddy setup out-of-the-box :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 3910
    • KomokaWeather
Re: Base Canada updates
« Reply #5 on: November 13, 2017, 11:11:36 PM »
Update - contacted GoDaddy, and two hours later...
The last message from GoDaddy is that they will not do anything in my current, old and outdated, hosting setup to accommodate this script's failure. 
I tried the code change in lines 725-726 as Ken mentioned but the same warning messages.
So have gone back to the previous ec_lightning.php www.komokaweather.ca/wxeclightning.php so no warnings/errors reported.

GoDaddy does offer a couple of suggestions:
1. With my current hosting I have one free (for one year) Classic Linux hosting to cPanel offer so I could move my www.komokaweather.ca (Saratoga site) on its own rather than redirect as the current www.komokaweather.com/komokaweather-ca and that would overcome some difficulties that now exist.
2. I can move all my hosting to cPanel at a current 10% discount for one year, or 20% for 2 years, or 30% for 3 years.  And then I can move to PHP v7

My hosting and domain names (7) renew in a month.
Secure hosting for multi domains is $150 a year on 5 year plan.  But the support person said that there are free alternatives such as Let's Encrypt that will work.

More dollars... but worse, much more work and potential headaches.  What to do?!

Paul




Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6534
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Base Canada updates
« Reply #6 on: November 14, 2017, 12:14:22 AM »
Ahh, sadness.  Their curl seems to honor the options to not verify just fine (since the curl fetch uses https for the main page HTML), but their stream ssl support does not.

I just tried on my GoDaddy (cPanel host) the unmodified 1.02 - 15-Oct-2017 script, and it worked fine. No errors.
Your Version 1.00 just used http for both HTML and images instead of https used in 1.02.  As long as the EC site allows http or https without complaint, that version will work.

So I guess that moving all your hosting to cPanel (or a different hoster) is a good idea to get the correct support.  If they have LetsEncrypt then that can save $$$ from a commercial cert -- I use LetsEncrypt on multiple hosts (1and1 Virtual Server, Dreamhost).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything