WordPress.org

Make WordPress Core

Opened 22 months ago

Last modified 22 months ago

#43110 new defect (bug)

Warning: WordPress could not establish a secure connection to WordPress.org

Reported by: subrataemfluence Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.2
Component: General Keywords: reporter-feedback
Focuses: Cc:
PR Number:

Description

Not sure if this is a core bug, but since the message has WordPress.org in it I thought it might have a relation with core. I have updated to 4.9.2 just today and occasionally, specially when the site is idle for some time, I am getting the following message:

Warning: 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 /var/www/wp-projects/multibase/wp-includes/update.php on line 348

However, if I refresh the page the message goes away and everything "seems" to be normal. I am on multisite setup and working at my localhost.

<?php
if ( $ssl && is_wp_error( $raw_response ) ) {
   trigger_error(
        sprintf(
        /* translators: %s: support forums URL */
        __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
        __( 'https://wordpress.org/support/' )
        ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
        headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
   );
        $raw_response = wp_remote_post( $http_url, $options );
}

Change History (2)

#1 @dd32
22 months ago

  • Keywords reporter-feedback added

Hi @subrataemfluence,

Are you still experiencing this?

In general, this warning is shown when there's a slow network connection between you and WordPress.org, which results in the connection timing out.

The simplest way of finding out if this is the cause, is to run the following code:

var_dump( wp_remote_get( 'https://api.wordpress.org/core/stable-check/1.0/', array( 'timeout' => 1 ) ) );

If that doesn't succeed, try increasing the timeout to 10 (seconds) if that succeeds, the issue is down to the network speed.
We set a reasonably low timeout on the API requests as most servers are on much faster connections than most development servers (which i where the error will show up).

#2 @dirkbez
22 months ago

@dd32 Where would you insert that code string?

Note: See TracTickets for help on using tickets.