Envato Market 2 not working

The Envato API uses CloudFlare, which isn’t capable of sending the packet necessary to generate a “connection reset by peer” error. If they blocked your server’s IP, you would be getting an HTTP 403 or 429 error code, which you are not.

It sounds like your web host doesn’t understand the problem. I suggest you ask them to forget about all the API token stuff and emphasize this error to them, which is a clear network error:

cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to api.envato.com:443
{“request_url”:“https://api.envato.com/whoami",“response_code”:"",“response_cf_ray”:"",“response_server”:"”}

Envato will not be able to fix this. It has to be done by your web host, and unfortunately if your web host refuses to acknowledge that it’s an issue, then you won’t be able to use the Envato Market plugin on that server. You could find an alternative web host though, and the issue would be rectified immediately.

1 Like

Hi @Wicko,

I’ve had a look and I can confirm the IP address you provided above is not being blocked by us.

Can you please have the following command executed from your server, and provide the output back here?

curl -sv https://api.envato.com/

This doesn’t include a token at all, it’s just testing the basic connectivity from your host to the Envato API. If there’s nothing in the way, you should get a 404 response (example below). If there is something blocking access, the response will be different.

$ curl -sv https://api.envato.com/
*   Trying 104.18.252.82:443...
* Connected to api.envato.com (104.18.252.82) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /usr/local/etc/openssl@1.1/cert.pem
  CApath: /usr/local/etc/openssl@1.1/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=CA; L=San Francisco; O=Cloudflare, Inc.; CN=envato.com
*  start date: Nov  3 00:00:00 2019 GMT
*  expire date: Oct  9 12:00:00 2020 GMT
*  subjectAltName: host "api.envato.com" matched cert's "api.envato.com"
*  issuer: C=US; ST=CA; L=San Francisco; O=CloudFlare, Inc.; CN=CloudFlare Inc ECC CA-2
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fbedd013c00)
> GET / HTTP/2
> Host: api.envato.com
> user-agent: curl/7.70.0
> accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
< HTTP/2 404
< date: Tue, 23 Jun 2020 01:21:00 GMT
< content-type: application/json
< content-length: 221
< set-cookie: __cfduid=d0fdc781cc77a8b9e7dd3fbae5006458a1592875259; expires=Thu, 23-Jul-20 01:20:59 GMT; path=/; domain=.envato.com; HttpOnly; SameSite=Lax
< x-amzn-requestid: d2ea0a70-5155-491c-8724-87d324c39263
< access-control-allow-origin: *
< x-amzn-errortype: MissingAuthenticationTokenException
< x-amz-apigw-id: OjrXZG_UoAMFkww=
< x-cache: Error from cloudfront
< via: 1.1 c62ce76477c393c91b7d90312c808127.cloudfront.net (CloudFront)
< x-amz-cf-pop: ATL50-C1
< x-amz-cf-id: 0YsVUN6nV4GrD8HEFKrdKbcld0rtVMRh_bM1d3DK4aLXCQrEhuuOAg==
< cf-cache-status: DYNAMIC
< cf-request-id: 03805cb0110000dfa18f367200000001
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< server: cloudflare
< cf-ray: 5a7a63c68824dfa1-MEL
<
* Connection #0 to host api.envato.com left intact
{"error": "The HTTP method and path you requested is invalid. Please check the API documentation at https://build.envato.com/api/ and ensure that you're using a valid path with the correct method.", "reason": "not-found"}

Once you provide that information it will hopefully become clear exactly where the issue is.

If you prefer you can raise a support ticket with our customer service team.

Looking forward to the details and helping you get this sorted out!

1 Like

Thanks for this. I run this on my server using SSH and this is what it returned.

sweetenings@sweetenings.co.uk [~]# curl -sv https://api.envato.com/
* About to connect() to api.envato.com port 443 (#0)
*   Trying 104.18.252.82... connected
* Connected to api.envato.com (104.18.252.82) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*       subject: CN=envato.com,O="Cloudflare, Inc.",L=San Francisco,ST=CA,C=US
*       start date: Nov 03 00:00:00 2019 GMT
*       expire date: Oct 09 12:00:00 2020 GMT
*       common name: envato.com
*       issuer: CN=CloudFlare Inc ECC CA-2,O="CloudFlare, Inc.",L=San Francisco,ST=CA,C=US
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.44 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: api.envato.com
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Tue, 23 Jun 2020 07:05:23 GMT
< Content-Type: application/json
< Content-Length: 221
< Connection: keep-alive
< Set-Cookie: __cfduid=dd5627b58110038f10c4c22acbcbc2d691592895923; expires=Thu, 23-Jul-20 07:05:23 GMT; path=/; domain=.envato.com; HttpOnly; SameSite=Lax
< x-amzn-RequestId: 24b0164d-a0f7-4fff-9394-1141b80ef3fa
< Access-Control-Allow-Origin: *
< x-amzn-ErrorType: MissingAuthenticationTokenException
< x-amz-apigw-id: Okdz_Hw2IAMFkaQ=
< X-Cache: Error from cloudfront
< Via: 1.1 8665f9406bb78184b32be2ca021b358d.cloudfront.net (CloudFront)
< X-Amz-Cf-Pop: DFW55-C2
< X-Amz-Cf-Id: gxFInVjMWEJjIjhNUWB0qoRYCR6a5dHgk3HdE1x0j9ZCRXp5y3kdYA==
< CF-Cache-Status: DYNAMIC
< cf-request-id: 038197fb2800000ef2d2bfa200000001
< Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< Server: cloudflare
< CF-RAY: 5a7c5c3eac3a0ef2-DFW
<
* Connection #0 to host api.envato.com left intact
* Closing connection #0
{"error": "The HTTP method and path you requested is invalid. Please check the API documentation at https://build.envato.com/api/ and ensure that you're using a valid path with the correct method.", "reason": "not-found"}sweetenings@sweetenings.co.uk [~]#```

@Wicko The output you pasted looks perfectly fine. If you don’t mind while we wait for @rosssimpson to log in, could you load up the following PHP script (perhaps in a file like http://sweetenings.co.uk/my-tls.php) and paste the results back here?

It will perform the same test from the PHP side. I also added the exact endpoint that the plugin is failing on for good measure.

<?php

function test($url, $headers = array()) {
	printf("Url: %s\n", $url);
	!empty($headers) && printf("Headers: %s\n", json_encode(array_keys($headers)));

	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($ch, CURLOPT_VERBOSE, true);
	curl_setopt($ch, CURLOPT_STDERR, $temp = fopen("php://temp", "w+"));
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	curl_setopt($ch, CURLOPT_USERAGENT, "WordPress/5.4.1; https://fake-blog.com/");

	if (($data = @curl_exec($ch)) === false) {
		printf("Failed due to error %d: %s\n", curl_errno($ch), curl_error($ch));
	}

	rewind($temp);
	$verbose = stream_get_contents($temp);
	fclose($temp);

	printf("Status: %d\n", curl_getinfo($ch, CURLINFO_HTTP_CODE));
	printf("Response:\n%s\n\n", $data);
	printf("Verbose:\n%s\n\n", $verbose);
	printf(str_repeat("-", 64) . "\n\n");
}

header("Content-Type: text/plain");

test("https://api.envato.com/");
test("https://api.envato.com/whoami", array(
	"Authorization" => "Bearer FAKE_TOKEN"
));

Thanks @Wicko, the output from the command shows that that server is able to communicate with our API without error.

Please do follow @baileyherbert’s advice about running that script on your server and sharing the output. The first test should return a 404 with the “missing method” error, as above, and the second test should fail with a 401 and a “missing or malformed API token” error.

If that all works, you can try again but this time replace FAKE_TOKEN with your real token value. All going well that should work fine, but if not then you can report back here (but please remove the actual token value before you post here, as it needs to be kept secret).

1 Like

I have added @baileyherbert script here https://www.sweetenings.co.uk/envato-test.php

output:
Url: https://api.envato.com/
Failed due to error 35: OpenSSL SSL_connect: Connection reset by peer in connection to api.envato.com:443
Status: 0
Response:

Verbose:
*   Trying 104.18.252.82:443...
* Connected to api.envato.com (104.18.252.82) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* OpenSSL SSL_connect: Connection reset by peer in connection to api.envato.com:443 
* Closing connection 0


----------------------------------------------------------------

Url: https://api.envato.com/whoami
Headers: ["Authorization"]
Failed due to error 35: OpenSSL SSL_connect: Connection reset by peer in connection to api.envato.com:443 
Status: 0
Response:


Verbose:
*   Trying 104.18.252.82:443...
* Connected to api.envato.com (104.18.252.82) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* OpenSSL SSL_connect: Connection reset by peer in connection to api.envato.com:443 
* Closing connection 0


----------------------------------------------------------------
1 Like

I currently now have 3 paid plugins with updates available an unable to donwload the updates.

Actually just tried the Envato Market again without any changes to the API added and got success. What failing just before I run this script. But only one Plugin is showing? Where are the others?

actually tested again and failed

replace FAKE_TOKEN with new API and got this.

Url: https://api.envato.com/
Failed due to error 35: OpenSSL SSL_connect: Connection reset by peer in connection to api.envato.com:443 
Status: 0
Response:


Verbose:
*   Trying 104.18.252.82:443...
* Connected to api.envato.com (104.18.252.82) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* OpenSSL SSL_connect: Connection reset by peer in connection to api.envato.com:443 
* Closing connection 0


----------------------------------------------------------------

Url: https://api.envato.com/whoami
Headers: ["Authorization"]
Status: 401
Response:
{"error": "Missing or malformed API token: You need to provide an API token to access the API. The token must be a 32 character long alphanumeric string. See https://build.envato.com/api/#token", "reason": "missing-token"}

Verbose:
*   Trying 104.18.252.82:443...
* Connected to api.envato.com (104.18.252.82) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=CA; L=San Francisco; O=Cloudflare, Inc.; CN=envato.com
*  start date: Nov  3 00:00:00 2019 GMT
*  expire date: Oct  9 12:00:00 2020 GMT
*  subjectAltName: host "api.envato.com" matched cert's "api.envato.com"
*  issuer: C=US; ST=CA; L=San Francisco; O=CloudFlare, Inc.; CN=CloudFlare Inc ECC CA-2
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x22de7e0)
> GET /whoami HTTP/2
Host: api.envato.com
user-agent: WordPress/5.4.1; https://fake-blog.com/
accept: */*

* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
< HTTP/2 401 
< date: Wed, 24 Jun 2020 08:33:15 GMT
< content-type: application/json
< content-length: 222
< set-cookie: __cfduid=d744634a876c9d623839fb09ad7c18abe1592987595; expires=Fri, 24-Jul-20 08:33:15 GMT; path=/; domain=.envato.com; HttpOnly; SameSite=Lax
< x-amzn-requestid: 5176a551-7bc3-438a-837c-999f65308cca
< access-control-allow-origin: *
< x-amzn-errortype: UnauthorizedException
< x-amz-apigw-id: On9nzGHqoAMFZ8A=
< x-cache: Error from cloudfront
< via: 1.1 b42c0cd65df4cfbb1108b5d381a0ce37.cloudfront.net (CloudFront)
< x-amz-cf-pop: DFW55-C1
< x-amz-cf-id: fmnXflf6tTWUOQ8tBgRPgXNO3Au78mrLJQ_xvF5hWR9ZcJcItDlgvg==
< cf-cache-status: DYNAMIC
< cf-request-id: 03870ecaba00000ed6240d6200000001
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< server: cloudflare
< cf-ray: 5a851a5798590ed6-DFW
< 
* Connection #0 to host api.envato.com left intact


----------------------------------------------------------------

Not sure if this is still relevant but this is the responce I finally gor from my hosting provider.

I apologize for the delay in responding to your request. We have been receiving a usually high number of requests recently. We appreciate your patience and understanding in this matter.

I’ve executed the curl request on the server, and the output ended with a 404 error, which does mean that the connection is established.


root@cloud [~]# curl -sv https://api.envato.com/
* About to connect() to [api.envato.com](http://api.envato.com/) port 443 (#0)
* Trying 104.18.252.82... connected
* Connected to [api.envato.com](http://api.envato.com/) (104.18.252.82) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* SSL connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate:
* subject: CN=[envato.com](http://envato.com/),O="Cloudflare, Inc.",L=San Francisco,ST=CA,C=US
* start date: Nov 03 00:00:00 2019 GMT
* expire date: Oct 09 12:00:00 2020 GMT
* common name: [envato.com](http://envato.com/)
* issuer: CN=CloudFlare Inc ECC CA-2,O="CloudFlare, Inc.",L=San Francisco,ST=CA,C=US
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.44 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: [api.envato.com](http://api.envato.com/)
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Wed, 24 Jun 2020 18:02:41 GMT
< Content-Type: application/json
< Content-Length: 221
< Connection: keep-alive
< Set-Cookie: __cfduid=d79808aaffaeaa9d3048b91524a3cdb0e1593021761; expires=Fri, 24-Jul-20 18:02:41 GMT; path=/; domain=.[envato.com](http://envato.com/); HttpOnly; SameSite=Lax
< x-amzn-RequestId: befbf4c4-5dfc-4189-bdf8-1196ce0d7252
< Access-Control-Allow-Origin: *
< x-amzn-ErrorType: MissingAuthenticationTokenException
< x-amz-apigw-id: OpRCNG3hIAMFnbA=
< X-Cache: Error from cloudfront
< Via: 1.1 [887bd97687a4d87a40bec84ee0cbbddf.cloudfront.net](http://887bd97687a4d87a40bec84ee0cbbddf.cloudfront.net/) (CloudFront)
< X-Amz-Cf-Pop: DFW55-C1
< X-Amz-Cf-Id: OMxXPt4jjAiFO4YakJLt68x5LMN26-MFpunOTdtaZWAN82b2Vx4Qcg==
< CF-Cache-Status: DYNAMIC
< cf-request-id: 0389181ed600000ef2ea8f1200000001
< Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< Server: cloudflare
< CF-RAY: 5a885c77b8a00ef2-DFW
<
* Connection #0 to host [api.envato.com](http://api.envato.com/) left intact
* Closing connection #0
{"error": "The HTTP method and path you requested is invalid. Please check the API documentation at https://build.envato.com/api/ and ensure that you're using a valid path with the correct method.", "reason": "not-found"}

So looks like the server is able to connect ok but is it at the Envato end that things are getting blocked.

regards

David

is there likely to be a resolve on this?

Thanks for the test results @Wicko! :smiley:

It seems like your server is able to connect, but periodically fails in the SSL step. The issue seems to be coming from OpenSSL and only happening periodically.

Would it be possible for you to set up a page with phpinfo so I can try to reproduce? e.g.

<?php
phpinfo();

https://www.sweetenings.co.uk/phpinfo.php

I set up a server with the same versions of PHP (7.3.19), cURL (7.70.0), and OpenSSL (1.1.1g), as well as all the same relevant configuration. I didn’t have any trouble connecting. :tired_face:

Verbose:
*   Trying 104.18.252.82:443...
* Connected to api.envato.com (104.18.252.82) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /opt/curl/ca-bundle.crt
  CApath: none
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=CA; L=San Francisco; O=Cloudflare, Inc.; CN=envato.com
*  start date: Nov  3 00:00:00 2019 GMT
*  expire date: Oct  9 12:00:00 2020 GMT
*  subjectAltName: host "api.envato.com" matched cert's "api.envato.com"
*  issuer: C=US; ST=CA; L=San Francisco; O=CloudFlare, Inc.; CN=CloudFlare Inc ECC CA-2
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x1ab7f00)
> GET /whoami HTTP/2

The error is occurring before your server connects to Envato’s servers, so I’m not sure this is something Envato can resolve on their side. Maybe @rosssimpson will have another idea, but it would be greatly helpful if your web host could track it down.

Personally I would just run this command 5-6 times until you see the “connection reset by peer” error. If you can’t get that error despite running it several times, then this is probably an issue specific to your PHP build.

curl -svvv https://api.envato.com/

yeah very odd. I am actually looking at setting a new sever up for this site and where it is at the moment was just my build area.
Not a lot else I can do. I am not really a server person.
Was thinking of moving to something like SiteGround or Linode for each site.
Oh I have about 30 sites mainly small.

1 Like

Thanks for the testing, @Wicko and @baileyherbert!

The “connection reset by peer” error message indicates that the caller (PHP and/or curl in this case) received a TCP RST packet from the other end of the connection. However, I am skeptical that it’s the Envato end of the connection that’s terminating the connection. More likely it is a transparent proxy or firewall device on your hosting provider’s side that’s doing so.

However, I can’t explain why testing with curl at the command line works fine (both you and your hosting provider proved that’s the case) but testing within PHP does not work. Perhaps the networking configuration of your server is such that PHP is using a different network interface or route than requests sent via the command line.

I know that’s not really any help, but without any further help from the provider I’m afraid there’s not much else we can do – all requests that we see from you are served appropriately. If this is a high priority to get working on the existing server, the next troubleshooting step will be to perform a packet capture while making a request from PHP on your server, and then sending that capture to us and your hosting provider for analysis. I can’t tell from your snippets above whether you have the required permissions to do this or not, but we can try. Please let me know if you’d like to do so.

If not, and you plan on trying this out on a different server, I’d be very happy to hear how that goes. I expect it will go fine, but will be here if you encounter trouble.

2 Likes

Here is the latest reply from Site5, my server company

Hello,

Thank you for the update.

I am able to replicate the issue where connecting to the plugin with the app API connection from our server end. Here I could see that intial error which you are getting the resposne output from the connection as ‘Failed to query total number of items in API response.Forbidden {“request_url”:“https://api.envato.com/v1/market/total-items.json",“response_code”:403,“response_cf_ray”:“5a5e7db6b93eecaa-DFW”,“response_server”:"cloudflare”}’.

This indicates that the connection is rejected from the server end due to various factors. We can see there might be more than one reason for this issue.

However, I noticed that once performing the connection iteration to the API https://api.envato.com/v1/market/total-items.json link works once and randomly as you see below and most of the time could see ‘curl: (56) SSL read: errno -5961’ or curl: (35) SSL connect errors.

=========================================================

  1. Connected:

root@cloud [/home/sweetenings/public_html/wp-content/plugins]# curl -IL https://api.envato.com/v1/market/total-items.json 443
HTTP/1.1 404 Not Found
Date: Tue, 07 Jul 2020 02:30:12 GMT
Content-Type: application/json
Content-Length: 0
Connection: keep-alive
Set-Cookie: __cfduid=dc29bae361eea2eeb68d3db7fa52646cd1594089012; expires=Thu, 06-Aug-20 02:30:12 GMT; path=/; domain=.envato.com; HttpOnly; SameSite=Lax
x-amzn-RequestId: 40bdee88-aea2-49e1-97e5-746ded1889e4
Access-Control-Allow-Origin: *
x-amzn-ErrorType: MissingAuthenticationTokenException
x-amz-apigw-id: PR-oLFlFIAMF7TQ=
X-Cache: Error from cloudfront
Via: 1.1 a43b25e4690d3514ec42aed46c3e2f79.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: IAH50-C1
X-Amz-Cf-Id: 7UxRfTV8Jx9zS2Zo5QZQmxxLP29EuJv3g4-qKVnEY-aAN9K53lHkTg==
CF-Cache-Status: DYNAMIC
cf-request-id: 03c8b513e90000b3bee7277200000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 5aee24664ecab3be-IAH

Connection Failure:

root@cloud [/home/sweetenings/public_html/wp-content/plugins]# curl -IL https://api.envato.com/v1/market/total-items.json 443
curl: (56) SSL read: errno -5961

root@cloud [/home/sweetenings/public_html/wp-content/plugins]# curl -k --tlsv1.2 -XGET https://api.envato.com/v1/market/total-items.json 443
curl: (35) SSL connect error

root@cloud [/home/sweetenings/public_html/wp-content/plugins]# curl -k --tlsv1.2 -XGET https://api.envato.com/v1/market/total-items.json 443
curl: (7) Failed to connect to 0.0.1.187: Invalid argument
{"error": "Missing or malformed API token: You need to provide an API token to access the API. The token must be a 32 character long alphanumeric string. See https://build.envato.com/api/#token", "reason": "missing-token"}

=========================================================

One of the reasons might be with

  • Firewall issue.
  • Curl outdated version
  • NSS outdated version

The outdated version of the cURL package might be causing this issue By default, curl will automatically negotiate up to TLSv1.1 but can be made to negotiate TLSv1.2. Currently, I could see that the curl and the NSS versions as you can see below:

Curl Version:

root@cloud [/home/sweetenings/public_html/wp-content/plugins]# curl --version
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.44 zlib/1.2.3 libidn/1.18 libssh2/1.4.
curl-7.19.7-54.el6_10.x86_64

* Tue Oct 01 2019 Kamil Dudka <kdudka@redhat.com> - 7.19.7-54
- fix auth failure with duplicated WWW-Authenticate header (#1757643)

NSS version:

NSS/3.44 z
* Wed Oct 23 2019 Bob Relyea <rrelyea@redhat.com> - 3.44.0-7
- Add back missing Mozilla Policy

The most recent stable version is 7.71. 1, released on the 1st of July 2020, and the NSS version is 3.57. I suggest you to upgrade curl as well as the NSS patch on your end and retest again to verify.

Please also let me know do you have any PHP cURL sample API connection test page to verify which includes the GET connections so we can verify the process.

If you have any questions or concerns please do not hesitate to reach out to our live support again. We are available 24x7.

Regards,

Sandeep G
Web Administrator
Site5 | http://www.site5.com

1 Like

Great! Looks like they see the issue now. :smiley:

Your host was able to replicate the error with command-line curl, which per their report is version 7.19.7. They correctly mentioned that this version is quite outdated, and asked you to upgrade.

However, PHP uses its own independent build of cURL which, per your phpinfo, is currently version 7.71.0 – the most recent stable version, and the same version they asked you to upgrade to in the end of their email.

I suggest replying to them and informing them that PHP’s cURL version is currently 7.71.0. They asked for a sample PHP page, so send them these links:

That should be enough evidence for them that the issue is unrelated to cURL and more likely to do with a firewall or something else on the network.

I am in the process of moving this entire test site to SiteGround hosting. Perhaps that will be more successful.