Closed lbenicio closed 4 years ago
Frankly speaking I'm not sure that I can help with this as you are using custom ciphers. Nevertheless leaving this PR open so someone else might find a solution
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
node process outputt
When did the problem start occurring? 12-17-19 (the day i tested)
How often does the problem occur? always
What is the URL? https://secure.tibia.com
Are there any similar issues? No
Please share a minimal working code snippet that reproduces the problem.
Code snippet
```js const cloudscraper = require('cloudscraper'); cloudscraper.defaultParams.agentOptions.ciphers += ':@SECLEVEL=5:@STRENGTH'; cloudscraper.defaultParams.agentOptions.sigalgs = 'ECDSA+SHA256'; const headers = Object.assign({}, cloudscraper.defaultParams.headers); const jar = cloudscraper.defaultParams.jar; cloudscraper.debug = true; const uri = 'https://secure.tibia.com'; // Visiting the page to simulate real user behavior and to get cookies cloudscraper.get({ uri, headers }).then(body => { // Log the cookies, should have `x-token` now console.log(jar); let token; jar.getCookies(uri).forEach(cookie => { if (cookie.key.startsWith('x-token')) { token = cookie.value; } }) if (!token) throw new Error('Failed to get token'); // Updating the headers to reflect the previous request Object.assign(headers, { 'Referer': uri, // This request is normally made via XHR, let's blend in. 'X-Requested-With': 'XMLHttpRequest' }); // The server sends the JSON with HTTP status 302 so disable automatic redirects // The request is not simple since it can end with a non-2xx response const options = { uri, headers, followRedirect: true, followAllRedirects: true, simple: false, followOriginalHttpMethod: true }; return cloudscraper.get(options) .then(body => { console.log(body) }).catch(console.error); }).catch(console.error); ```program output
```js REQUEST { requester: [Function: request] { get: [Function (anonymous)], head: [Function (anonymous)], options: [Function (anonymous)], post: [Function (anonymous)], put: [Function (anonymous)], patch: [Function (anonymous)], del: [Function (anonymous)], delete: [Function (anonymous)], jar: [Function (anonymous)], cookie: [Function (anonymous)], defaults: [Function (anonymous)], forever: [Function (anonymous)], Request: [Function: Request] { debug: true, defaultProxyHeaderWhiteList: [Array], defaultProxyHeaderExclusiveList: [Array] }, initParams: [Function: initParams], debug: [Getter/Setter], bindCLS: [Function: RP$bindCLS] }, jar: RequestJar { _jar: CookieJar { enableLooseMode: true, store: { idx: {} } } }, headers: { Host: Symbol(host), Connection: 'keep-alive', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36', Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'Accept-Language': 'en-US,en;q=0.8', 'Accept-Encoding': 'gzip, deflate, br' }, cloudflareMaxTimeout: 30000, followAllRedirects: true, challengesToSolve: 3, decodeEmails: false, gzip: true, agentOptions: { ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA:!ECDHE+SHA:!AES128-SHA:@SECLEVEL=5:@STRENGTH', sigalgs: 'ECDSA+SHA256' }, uri: 'https://secure.tibia.com', method: 'GET', realEncoding: 'utf8', encoding: null, callback: [Function: RP$callback], transform: undefined, simple: true, resolveWithFullResponse: false, transform2xxOnly: false } REQUEST make request https://secure.tibia.com/ RequestError: Error: 139724139898752:error:14215076:SSL routines:tls12_copy_sigalgs:no suitable signature algorithm:../deps/openssl/openssl/ssl/t1_lib.c:1689: 139724139898752:error:141DD044:SSL routines:tls_construct_ctos_sig_algs:internal error:../deps/openssl/openssl/ssl/statem/extensions_clnt.c:284: at onRequestResponse (/root/node_modules/cloudscraper/index.js:165:21) at Request.