• Resolved epiron

    (@epiron)


    Hi,

    Any Curl requests to https://smushpro.wpmudev.com/1.0/ failed on my website!

    *   Trying 165.227.251.120:443...
    * Connected to smushpro.wpmudev.com (165.227.251.120) port 443 (#0)
    * ALPN, offering http/1.1
    * successfully set certificate verify locations:
    *   CAfile: E:\php\php-7.4.29-nts-Win32-vc15-x64\extras\ssl\cacert.pem
      CApath: none
    * Operation timed out after 5008 milliseconds with 0 out of 0 bytes received
    * Closing connection 0

    cURL error number:28
    cURL error:Operation timed out after 5004 milliseconds with 0 out of 0 bytes received

    Array
    (
        [url] => https://smushpro.wpmudev.com/1.0/
        [content_type] => 
        [http_code] => 0
        [header_size] => 0
        [request_size] => 0
        [filetime] => -1
        [ssl_verify_result] => 1
        [redirect_count] => 0
        [total_time] => 5.004788
        [namelookup_time] => 0.094297
        [connect_time] => 0.265778
        [pretransfer_time] => 0
        [size_upload] => 0
        [size_download] => 0
        [speed_download] => 0
        [speed_upload] => 0
        [download_content_length] => -1
        [upload_content_length] => -1
        [starttransfer_time] => 0
        [redirect_time] => 0
        [redirect_url] => 
        [primary_ip] => 165.227.251.120
        [certinfo] => Array
            (
            )
    
        [primary_port] => 443
        [local_ip] => 192.168.72.10
        [local_port] => 58949
        [http_version] => 0
        [protocol] => 2
        [ssl_verifyresult] => 0
        [scheme] => HTTPS
        [appconnect_time_us] => 0
        [connect_time_us] => 265778
        [namelookup_time_us] => 94297
        [pretransfer_time_us] => 0
        [redirect_time_us] => 0
        [starttransfer_time_us] => 0
        [total_time_us] => 5004788
    )
Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter epiron

    (@epiron)

    I can open the URL on the browser: https://smushpro.wpmudev.com/1.0/

    {"success":false,"data":"No file content sent."}

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @epiron,

    I’m afraid the cURL error would point to more of a server-side error. Could we know whether you brought this to your hosting provider’s attention?

    Please check this article for the reasons for the cURL error to occur:
    https://docs.presscustomizr.com/article/326-how-to-fix-a-curl-error-28-connection-timed-out-in-wordpress

    If there is any firewall enabled, please make sure to whitelist all our IPs to ensure the issue isn’t due.

    Please check the following doc for more info about the list of IPs that needs to be whitelisted:
    https://wpmudev.com/docs/getting-started/wpmu-dev-ip-addresses/

    Please do let us know how that goes.

    Kind Regards,
    Nithin

    Thread Starter epiron

    (@epiron)

    I found the issue. The problem is related to TLS 1.3 handshaking and for some unknown reasons requests to smushpro.wpmudev.com are stuck at TLS handshaking on curl PHP bundled version (7.70.0).
    It hangs after:

    TLSv1.3 (OUT), TLS handshake, Client hello (1)

    With the latest curl (7.83.1) standalone installation, it’s not getting errors. The temp solution to fix it is to force the max TLS version to 1.2 on curl requests:

    add_action('http_api_curl', function( $handle ){
        curl_setopt($handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_MAX_TLSv1_2);
     });

    Hello @epiron !

    Good debugging there! Which version of PHP are you using on the site at the moment?

    As far as I remember, there were some bugs in the PHP/CURL system a few years back, one example here: https://bugs.php.net/bug.php?id=78414 (probably not exactly the same case).

    Are you able to switch the PHP version to a different one (newer preferably) and check if it works without the filter?

    Best regards,
    Pawel

    Thread Starter epiron

    (@epiron)

    I use 7.4.29 which has curl 7.70.0. I’ll try PHP 8 later to see if the issue exists or not.

    As far as I checked, the issue exists on curl 7.70.0 and fixed on the latest curl (which is 7.83.1 at the moment). So, I think it’s related to own curl library not the php_curl implementation.

    Hi there @epiron and @wpmudev-support9

    Jumping in here with some more info.

    I upgraded my site to WordPress 6.0 and updated Smush to the latest version today.
    Immediately, site became very sluggish. Multiple requests per second in the access log, throwing 499 errors.

    Dug into it, found a similar thing to what @epiron reported above, CURL requests to a smushpro site which seemed to be causing the load. See screenshot from New Relic: https://i.imgur.com/1CS3WI7.png

    Deactivated Smush and the site came good instantly, so 100% confirmed that the problem relates to Smush.

    My site is hosted on WPEngine, PHP 8.0.17, WordPress 6.0

    Hope that helps in some way.

    Thanks

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @epiron @barold01,

    Thanks for the information. I’m escalating this further to our developer’s attention so that we could further investigate further regarding this.

    Will keep you posted once we get further feedback.

    Kind Regards,
    Nithin

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @epiron,

    Seems like the issue is more related to TLS 1.3 as you have stated. At the moment, I’m afraid Smush doesn’t have 1.3 as it isn’t widely supported and only recently implemented for browsers too.
    https://caniuse.com/tls1-3

    However, our team is already working to implement and support TLS1.3. At the moment there isn’t any exact ETA, but you can follow our roadmaps for more updates regarding this.
    https://wpmudev.com/roadmap/

    @barold01 thanks for your feedback, however, we tested with a site hosted in WP ENGINE but couldn’t replicate the issue.

    We could notice WP Engine supports both TLS 1.2 and 1.3, and Smush did work out of the box since TLS 1.2 was supported out of the box.

    If you still have issues regarding this, then could you please open a new ticket with us along with the website URL, so that it would help us to give a closer look if needed?

    Looking forward to your response.

    Kind Regards,
    Nithin

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @epiron,

    Since we haven’t heard from you for a while. I’ll mark this thread as resolved for now. Please feel free to re-open the thread if you need further assistance.

    Best Regards
    Nithin

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Curl Requests Failing’ is closed to new replies.