Начала вылезать ошибка curl "error code: 1020"
spoiler* Trying 104.17.172.159:443...
* Connected to poloniex.com (104.17.172.159) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=sni.cloudflaressl.com
* start date: Jun 2 00:00:00 2022 GMT
* expire date: Jun 1 23:59:59 2023 GMT
* subjectAltName: host "poloniex.com" matched cert's "poloniex.com"
* issuer: C=US; O=Cloudflare, Inc.; CN=Cloudflare Inc ECC CA-3
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Using HTTP2, server supports multiplexing
* 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 0x555e7e23edc0)
> POST /tradingApi HTTP/2
Host: poloniex.com
user-agent: Mozilla/4.0 (compatible; Poloniex PHP bot; Linux vm-ad9c5aa6 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 x86_64; PHP/8.1.2-1ubuntu2.11)
accept: */*
key: 28G54BHN-GJMCOC06-H00G4Q8F-W4U8UG4T
sign: 35186afc0da82c76fe8a4ba22338f35267dc059b7c88d27985cb1898ff512a3dd7a1f19f1c4cf8239ae3795b391c82f6647e5b722ac02fdca65dcf535333ba19
content-length: 61
content-type: application/x-www-form-urlencoded
* We are completely uploaded and fine
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
< HTTP/2 403
< date: Sat, 04 Mar 2023 06:36:20 GMT
< content-type: text/plain; charset=UTF-8
< content-length: 16
< x-frame-options: SAMEORIGIN
< referrer-policy: same-origin
< cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< expires: Thu, 01 Jan 1970 00:00:01 GMT
< strict-transport-security: max-age=15552000; includeSubDomains
< x-content-type-options: nosniff
< server: cloudflare
< cf-ray: 7a281ab13b3b3595-DME
<
* Connection #0 to host poloniex.com left intact
private function query(array $req = array()) {
// API settings
$key = $this->api_key;
$secret = $this->api_secret;
// generate a nonce to avoid problems with 32bit systems
$mt = explode(' ', microtime());
$req['nonce'] = $mt[1].substr($mt[0], 2, 6);
// generate the POST data string
$post_data = http_build_query($req, '', '&');
$sign = hash_hmac('sha512', $post_data, $secret);
// generate the extra headers
$headers = array(
'Key: '.$key,
'Sign: '.$sign,
);
// curl handle (initialize if required)
static $ch = null;
if (is_null($ch)) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT,
'Mozilla/4.0 (compatible; Poloniex PHP bot; '.php_uname('a').'; PHP/'.phpversion().')'
);
}
curl_setopt($ch, CURLOPT_URL, $this->trading_url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_VERBOSE, true);
// run the query
$res = curl_exec($ch);
if ($res === false) {
throw new \Exception('Curl error: '.curl_error($ch));
}
$dec = json_decode($res, true);
if (!$dec){
//throw new Exception('Invalid data: '.$res);
return false;
}
else{
return $dec;
}
}
Неделю назад все работало хорошо. Подскажите, куда копать.