• I have noticed several things that seem to point to an error in access to WordPress.org after a change in my server location and network. I see the following in various logs:

    debug.log:
    [28-Dec-2024 18:23:48 UTC] PHP Warning: wp_update_themes(): An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /www/ossgarden/htdocs/wp/wp-includes/functions.php on line 6114

    In the Apache logs:
    Dec 28 12:12:10.458648 2024] [zend_enabler:error] [pid 2511:tid 00000034] Can not read response from /QOpenSys/pkgs/bin/php-cgi (0.0) – [3447] A remote host did not respond within the timeout period.

    and this:

    Fatal error: Maximum execution time of 300+2 seconds exceeded (terminated) in /www/ossgarden/htdocs/wp/wp-includes/Requests/src/Transport/Curl.php on line 204

    The WordPress Events and News widget has this: RSS Error: WP HTTP Error: cURL error 28: Resolving timed out after 10030 milliseconds

    All of these symptoms seem to point to a network connectivity issue. So far I tried a ping to the wordpress.org domain from the command line (successful). A trace route (successful). I ran curl https://wordpress.org and it returns content from the website. So, it seems that I do have connectivity to the WordPress.org website from the server and yet the logs seem to indicate otherwise.

    I have a second site on the same server that basically has the same symptoms. It appears the problem started when the server was moved in June but I am at a loss as to what else to use to check connectivity from the actual WP installation. Command-line access to wordpress.org seems OK.

    I don’t recall there being any network settings in WP. The VLAN/subnet this server is on is identical to the previous location. Server gateway is still the same, the only thing that changed, besides the physical location, is the firewall (changed from Meraki to Unbiquity) and the external IP. I checked the firewall settings and logs and I don’t see anything that would block an outbound connection. So, I’m stumpted. If your response is “Ask your network team to help you”… I AM the “network team”. Is there a diagnostic from WP I should try that might reveal the issue?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator threadi

    (@threadi)

    I would guess that the firewall is the cause. This or a similar security tool in some hostings is usually the reason for this.

    Your test with curl comes close to the real test, but is not identical to calling WordPress to reach wordpress.org. The request from WordPress originates from the PHP process, which in turn is associated with a web server process (Apache/nginx). This may be handled differently by firewalls.

    WordPress does not offer any tests for this (as these are absolutely special cases in which something like this occurs and the hosting support has to take care of setting up the systems correctly), but I see 2 possibilities that you could still test:

    • Turn off the firewall completely as a test. If it then works, you know that it is the firewall after all.
    • Write a PHP script that calls wordpress.org via PHP-CURL. It is best to display the debug output here. Place the script in the main directory of WordPress and call it via browser. If this does not work, you can rule out the WordPress core as the cause (which I assume) and check further in your own network.
    Thread Starter petehelgren

    (@petehelgren)

    Wow…somehow I lost a lengthy response to this….
    I did take option 2 from above and ran this script:

    <?php
    // Initialize cURL session
    $ch = curl_init();

    // Set cURL options
    curl_setopt($ch, CURLOPT_URL, "https://wordpress.org");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return the response as a string
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow redirects, if any
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // Verify SSL certificate

    // Optional: Set a user agent
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36");

    // Execute the cURL request
    $response = curl_exec($ch);

    // Check for errors
    if (curl_errno($ch)) {
    echo "cURL Error: " . curl_error($ch);
    } else {
    // Print the response
    echo "Response from WordPress.org:\n";
    echo $response;
    }

    // Close the cURL session
    curl_close($ch);


    It returned content so I don’t think firewall is an issue. I went back and retraced my steps. The timeout is set to 300 seconds, which by my calculations is 300,000 milliseconds which is why I wonder that the WordPress Events and News widget has this: RSS Error: WP HTTP Error: cURL error 28: Resolving timed out after 10030 milliseconds. Is there some other cURL setting somewhere?….

    Clicking on the “Updates” and waiting for 300+2 seconds before it times out reveals this:
    Secure Connection Failed. The page you are trying to view cannot be shown because the authenticity of the received data could not be verified. Which is again strange, because the domain is secured by a wildcard certificate and other WP pages will display just fine. It’s the wp-admin functions that seem to have issues. The error on checking for updates occurs on the /wp-admin/update-core.php file which should be OK. The Apache directives don’t explicitly allow access to the wp-admin folder but that shouldn’t be necessary since it is a subfolder of the wp folder that is explicitly allowed with a “Require all granted” directive.

    Still digging but reall.y appreciate your response

    • This reply was modified 1 year, 3 months ago by petehelgren.
    • This reply was modified 1 year, 3 months ago by petehelgren.
    Moderator threadi

    (@threadi)

    The Secured Connection message has nothing to do with your domain’s SSL certificate. It is about an outgoing HTTP connection that must be secured via SSL. To do this, your system must provide the corresponding SSL libraries, without which curl would not run at all as far as I know. It is also possible that it is precisely these libraries that are failing if they are using root certificates that are too old. How you can check this depends on the hosting system.

    Also note that WordPress does not send most requests for updates etc. to wordpress.org but to https://api.wordpress.org. See also: https://codex.wordpress.org/WordPress.org_API

    Thread Starter petehelgren

    (@petehelgren)

    Once again, Thanks! So, what I am trying to wrap my head around is that the script I posted contacted the https://wordpress.org site successfully using SSL, so what change to the SSL libraries would be needed to have a successful connection? If I can connect to https://wordpress.org, what would I need to test differently to access https://api.wordpress.org? Seems like if I connect with SSL to using PHP cURL to https://wordpress.org, that confirms that SSL is correctly configured (or maybe not?).

    Circling all the way back, this problem started with a relocation of the server and a change to the network infrastructure. Nothing on the server changed when my WP sites stopped accessing the https://wordpress.org site. Yes, that seems to point to a networks issue. The only “network” issue I can determine right now is that I have this issue in “Site Health” dashboard:

    Your site is unable to reach WordPress.org at 198.143.164.251, and returned the error: cURL error 28: Resolving timed out after 10009 milliseconds, which is confusing in that the timeout in the wp-config.php file is 300 seconds. Maybe if I solved the timeout by extending it, that would fix the issue. I thought changing the wp-config.php file would extend the timeout, but even that didn’t seem to fix the 10004 millisecond timeout….

    Again, thanks for all the assistence.

    Thread Starter petehelgren

    (@petehelgren)

    So, trying to get an answer here to at least this question: The timeout says 10034 milliseconds, that is roughly 10 seconds. Yet, I cannot find anything close to that value in any php or WP config files. Where does the cURL 10 second timeout value live?

    Moderator threadi

    (@threadi)

    This is not a timeout that you should increase as a solution or anything similar. You should look for the cause of the missing connection. Please also take a look at this article: https://kinsta.com/knowledgebase/curl-error-28/

    Thread Starter petehelgren

    (@petehelgren)

    Really appreciate the post and link. I have tried all 6 of those approaches. As I posted above, I created a php page that has a cURL call to https://wordpress.org It takes 11.6 seconds to respond so that is why I was trying to figure out how to change the timeout since, at least on my server, the call to wordpress.org takes more than 10 seconds.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Access to wordpress.org failing’ is closed to new replies.