3

This is a copy of a question that I posted at the Joomla support forums:

When I try to set the Force HTTPS option using the admin facility I get the following warning message:

Warning
HTTPS has not been enabled as it is not available on this server.
HTTPS connection test failed with the following error:
Operation timed out after 1000 milliseconds with 0 bytes received

enter image description here

But if I edit the configuration.php file and set $force_ssl to '2' then it works.

I'm guessing this has something to do with running under IIS and/or running on an Azure VM.

How can I resolve this warning?

  • No, but I have experienced it too, on an lxc virtual machine on an ubuntu server host, so it may be related to the private network – Riccardo Zorn Jan 6 at 21:03
  • suggest you to use good software (open source, apache or nginx) ;-) okay, honest support now ;-) can you share the access logs from your webserver (IIS)? – laendle Apr 6 at 13:46
1

The message is generated because the call to curl the site's root url with https threw an exception so that's where to look.

The try/catch block is in administrator/components/com_config/model/application.php lines 126-159, so if you can single-step through there in a debugger you should see what's going wrong. No debugger? Inserting echo statements at appropriate places will help, so long as you don't mind things like that trashing your view in the admin panel. (I suppose you could try and log to the console output, if you'd rather.)

If your problem is that curl isn't available, and it's failing because that, I'm afraid I have no knowledge about how to install that for IIS (I'm just assuming its possible, b/c MS at one time was distributing Joomla on one of their web application CDs when they were courting PHP devs for IIS). I suspect it's as simple as locating the php.ini file and turning it on, though (check the "System Information" panel under 'System' in the Joomla admin for details on where to find it).

Also, thanks to @mickmackusa I took a second look at that error; forget what I said about $response. My bad. It has no effect on this particular error.

JHttpFactory::getHttp($options)->get('https://' . $host . JUri::root(true) . '/', array('Host' => $host), 10);

is the line that is failing. Yeah it looks like a batch of gobbledy-gook (that's what I hate about the so-called "fluent" approach to coding; it's confusing to read) but I'll break it down for you:

JHttpFactory::getHttp($options)

is what gets the tool that will make the http request. Since you're not getting an error about a bad method call, I think we can assume that call is succeeding. Therefore:

get('https://' . $host . JUri::root(true) . '/', array('Host' => $host), 10);

is probably our culprit. There are three arguments passed in:

  1. URL as string
  2. array of headers to send
  3. timeout limit in seconds

From the error message we see it waited the ten seconds and came back empty-handed. This probably excuses the headers from the likely problem list, so we're left with the other two, which might mean:

  1. The URL is bad
  2. Your server is taking too long to respond, possibly because it can't find itself. (Sounds strange, but I've seen it happen.)

So first try to echo out the URL string being built, then try to contact that same URL from the server. If you time out, there's either something wrong at the server itself, or with the resolution of the name (you can ping the domain string -- www.example.com -- from the server's command line). Watch the time it takes to get a response, maybe it's just slow. Timeout values are hard; set them too long and users get impatient waiting for a response and leave before seeing the error, too short and slow machines trigger errors needlessly.

  • Thank you for your contribution (one of many in your blitz today). This post however is not yet a "complete answer". It is providing guidance about how to run diagnostics (which of course is helpful and what the OP originally asked for, but does not by itself state how to fix the issue -- which is what researchers will desire). When a question lacks sufficient details to write a precise solution, please comment under the question about the steps that should be taken to clarify the question. Optionally, if a question is not sufficiently clear, you may vote to close the question as Unclear. – mickmackusa Aug 14 at 22:45
  • Yeah, I hit a batch of slack time yesterday, waiting on things; some days are like that. ;{>} The problem with writing what to do next is it depends upon what is discovered by the steps there. It might be as simple as curl not being present (we are talking about an IIS system, after all) or it might be indicated by the response code. I was waiting for the OP to come back with data from the process I suggested (or saying there was no way they could do it, for whatever reason) before continuing, but I can flesh that out a little more. – Arlen Aug 15 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.