Author Topic: SSL/HTTPS automatic switching issue  (Read 19940 times)

Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
SSL/HTTPS automatic switching issue
« on: May 18, 2016, 06:22:24 AM »
Hi,

I had SSL/HTTPS working just fine for a few days.  My host moved me to a new server and since then I've had issues with the site automatically changing to HTTPS. 

If I visit my site using the HTTPS prefix then it works just fine BUT if I visit using HTTP then click on Cart/Checkout/Register/Login/Account etc it does not flip over to HTTPS as it should.  I'm starting to lose my sense of humour about this as I keep getting issues with HTTPS and this server move hasn't helped at all :(

site is tranquili-tea dot co dot UK <- sorry I can't post links yet :(

Any help greatly received :)

Abantecart v1.2.7 is installed.
HTTPS is on
Store URL is set to http:// www dot tranquili-tea dot co dot uk/
SSL Store URL is set to https:// www dot tranquili-tea dot co dot uk/
« Last Edit: May 18, 2016, 06:35:37 AM by moosehound »

Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #1 on: May 18, 2016, 06:53:53 AM »
Actually scratch that - I now just redirected to the HTTP site instead - so I'm not even getting served the HTTP certificate/site I don't think...

I do have the following in my htaccess file..:

RewriteCond %{HTTP_HOST} ^tranquili-tea dot co dot uk [NC]
RewriteRule ^(.*)$ http :// www dot tranquili-tea dot co dot uk/$1 [L,R=301]

Offline eCommerce Core

  • Administrator
  • Hero Member
  • *****
  • Posts: 1602
  • Karma: +93/-1
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #2 on: May 18, 2016, 08:04:10 AM »
I see HTTPS and HTTP working on your site.
“If you’re in the luckiest one per cent of humanity, you owe it to the rest of humanity to think about the other 99 per cent.”
― Warren Buffett

Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #3 on: May 18, 2016, 08:06:24 AM »
Really?  Why isn't it showing for me?  I've tried Safari, Chrome, Edge on 3 different devices.  I've even tried Phone and Tablet too yet I get the same problems.. :(  Caching?

I just get the regular site with HTTPS at the start but no lock/key symbol and no cert issued...

Thanks for looking :D
« Last Edit: May 18, 2016, 08:12:26 AM by moosehound »

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1798
  • Karma: +520/-7
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #4 on: May 18, 2016, 04:25:55 PM »
you can use this to check your ssl
https://www.sslshopper.com/ssl-checker.html

HTTPS is on
Store URL is set to http:// www dot tranquili-tea dot co dot uk/

Try  using https://  (that is the site you prefer)

you need to add the https into your .htaccess file for the where you have your store - if root,  then in htaccess root,  if in /dir  ,  in the /dir htaccess file
RewriteEngine on RewriteCond %{HTTPS} !=on RewriteRule (.*) https://example.com/$1 [R]

OR this
RewriteEngine on RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]






Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #5 on: May 19, 2016, 04:37:17 AM »
Hi, thanks for the reply :)

So, I use that site and my SSL cert is being served just fine by the looks.

If I add either of those two lines to my htaccess I get Error 500 Internal Server Error and nothing is reachable until I comment those back out again (and yes I changed the domains to my domain ;) ).

What I DO get though when I try and use those lines in htaccess and get the error page is a green secure key next to the https address - so when the site fails to load/activate the store https secure connection appears to be fine.  This would lead me to believe something to do with the store loading or config is causing HTTPS to go wonky.  The only things I have added to my htaccess are the two lines in my post above that I use to redirect requests to tranquili-tea dot co dot uk to www dot tranquili-tea dot co dot uk.  That and the SEO stuff mentioned during setup.

Like I say this worked just fine for a few days then my web host managed to enter a duplicate SSL cert on my box which caused me issues.  They've removed this now and the cert seems to be dished out fine it's just that AbanteCart no longer seems to use it....

Thanks for all the help, it's really got me stumped....  should I just backup, wipe and reinstall?

:)

Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #6 on: May 19, 2016, 07:53:30 AM »
I've attached a screen shot (and my current htaccess) of the behaviour I am getting - here you can see that the site is loading over HTTPS, has a valid certificate yet still no secure "lock/key" symbol...

I can place something like:
 RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https :// <YOURURL> $1 [R,L]

in my htaccess but I still get the problem that the SSL portion just isn't engaging....
« Last Edit: May 19, 2016, 08:16:19 AM by moosehound »

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1798
  • Karma: +520/-7
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #7 on: May 19, 2016, 10:29:17 AM »
have you renamed your .htaccess.txt file  to just .htaccess    (leave the dot in the front,  only remove the .txt)


Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #8 on: May 19, 2016, 10:39:29 AM »
Hi,

Yeah I've done that :) 

So, I put back a new htaccess, removed and readded the SSL cert on the box, cleared all caches, restarted devices and it finally work - all apart from Chrome but I think that's just a caching issue...  It was a weird one but it seems to now be working as it should :)

Thanks for the help everyone :D

Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #9 on: May 19, 2016, 03:08:29 PM »
Aaaaaaaannnnnnnddddd it's stopped working again :(

It really looks like I make a request to the webserver.  It services the HTTPS request and then it redirects the page back to HTTP again.   You can see, on Safari, the lock appear next to the site name then it refreshes the address bar and loads the none-https page...

Anyone?  I've literally done nothing other than activate Paypal Pro, turn off showing the postage estimates and changing some of the descriptions in my products...

If I go to the admin panel on my site and use https ://etc then it works just fine so it's something on the storefront.... Is there a config file that gets updated when you say to use SSL?  Perhaps that setting is getting corrupted or not set properly? 

Also, if I put the sit ein maintenance mode it connects to it with HTTPS just fine...
« Last Edit: May 19, 2016, 03:45:19 PM by moosehound »

Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #10 on: May 20, 2016, 03:58:31 AM »
Hi!

Me again... I know I'm talking to myself :)

So.... It's now working again.... what did I do?  I went in to System and turned the logging options on , saved the page then reloaded the store... and it started working....  This makes me think it's just not writing "something" to a config files or that file is getting corrupted/overwritten by another part of the system and it happens that writing these settings has but things back... for now...

Anyone have any thoughts?  I seem to be able to "break it" again by turning off the Template Debugging option...
« Last Edit: May 20, 2016, 04:22:46 AM by moosehound »

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: SSL/HTTPS automatic switching issue
« Reply #11 on: May 20, 2016, 07:53:32 AM »
Config files or htaccess are not overridden by system.

If you set up HTTPS url into HTTPS setting in admin -> system, only customer, cart and checkout related pages will be using HTTPS

If you prefer ALL the pages to have HTTPS (not needed), set the main URL in settings to HTTPS. 
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #12 on: May 22, 2016, 05:59:24 AM »
Hi,

Yes, this is the behaviour I am expecting but I keep getting this (see pic) where it says it's using HTTPS but it's not using the cert...


It also seems to work for a short while then I get back to this again....

Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #13 on: May 22, 2016, 06:06:03 AM »
OK, it's official, if I go in to Settings>System and save the page then SSL starts working again... for awhile...  Any ideas?  The only thing in my logs is:

Code: [Select]
Name
Info
9101::App Warning
Extension banner_manager overrides core template with blocks/banner_block/one_by_one_slider_banner_block.tpl in /home/zethwa/public_html/tranquili-tea.co.uk/core/engine/view.php on line 287
9101::App Warning
Extension banner_manager overrides core template with blocks/banner_block_content.tpl in /home/zethwa/public_html/tranquili-tea.co.uk/core/engine/view.php on line 287

Offline moosehound

  • Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
    • View Profile
Re: SSL/HTTPS automatic switching issue
« Reply #14 on: May 27, 2016, 08:38:28 AM »
Still no thoughts on this one?  Seems weird that simply going in, setting Template Debug On, then Off, then On again followed by saving the page, should get HTTPS to function again for a short while...  Anyone... or should I just backup the site, remove it totally, reinstall and restore the backup?

 

Powered by SMFPacks Social Login Mod