Configuring Cloudflare HTTPS with Auto-SSL issued to domain by cPanel

Thanks, I’ll get it installed and fix the mixed content issue. Meanwhile hoping for some solution on the SSL issue. Cloudflare support engineer suggests that its an issue on the hosting server side. Further ticket replies as below;

From Cloudflare

Hi Shashank,

If you were experiencing issues with your SSL configuration or validation, I would expect a 525 or 526 error.

For 502 errors, we would simply proxy the error being received from the origin back to the client so this should be appearing in the logs on the origin. I have pinpointed the exact request shown in the screenshot by RayID and can confirm that this was the case in this instance.

When I ran a curl to check the transaction timing both directly to your site and through Cloudflare, I can see considerably slower than expected TTFB timings both directly to your site and through Cloudflare, although Cloudflare is slightly quicker (listed as time_starttransfer)

$ curl -w "@curl-format.txt" -o /dev/null -s "http://saamana.com/"

time_namelookup:  0.258505
time_connect:  0.438392
time_appconnect:  0.000000
time_pretransfer:  0.438530
time_redirect:  0.000000
time_starttransfer:  3.192358
                    ----------
time_total:  3.192461

$ curl -w "@curl-format.txt" -o /dev/null -s "http://saamana.com/" --connect-to ::104.27.188.157

time_namelookup:  0.000049
time_connect:  0.157898
time_appconnect:  0.000000
time_pretransfer:  0.157999
time_redirect:  0.000000
time_starttransfer:  2.130494
                    ----------
time_total:  2.130578

Additionally, I can see dropped packets in MTR from Cloudflare to the origin which could be exacerbating the issue and causing these 502’s to occur.

host            loss %  rcvd packets  sent packets  best  avg  worst
--------------  ------  ------------  ------------  ----  ---  -----
141.101.70.1    0       30            30            0     3    14   
195.66.226.204  0       30            30            0     2    20   
182.79.141.48   0       30            30            129   130  137  
125.19.200.162  0       30            30            129   129  129  
-               -       -             -             -     -    -    
103.*.*.45   20000   24            30            135   136  147  

You may wish to use the above or WebPageTest to generate some logs you can generate to share with your hosting provider to show that there is an issue here.

Let me know if you need any further help and I will try to assist.

My response as below

Thanks for the detailed explanation. Just so that I have a strong case when I talk to the hosting support, can you please explain to me why does this issue occur only on https:// setup and not on http:// ?

We’ve been using Cloudflare on http:// for the past couple of years and despite a slow site load time, everything seemed to work correctly. In fact, even now when I turn off SSL on the domain and then enable Cloudflare it works correctly. The issue arises only on https:// setup.

Any idea why would this be happening?