Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

Commit

Permalink
feat: add ciphers for https, helps avoid captcha on node 10 see codem…
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed Aug 18, 2019
1 parent ef89dc6 commit 11dde1e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import got, { Response, RetryOptions } from 'got';
import { Buffer } from 'buffer';
import crypto from 'crypto';
import delay from 'delay';
import got, { Response, RetryOptions } from 'got';
import https from 'https';
import uaString from 'ua-string';
import vm from 'vm';
import { Buffer } from 'buffer';

const BUG_REPORT = `\
Cloudflare may have changed their technique, or there may be a bug in the script.
Expand Down Expand Up @@ -201,6 +203,15 @@ export async function catchCloudflare<T extends Buffer | string | object>(
jschl_answer: challenge.answer,
s,
};

if (!config.agent) {
config.agent = {
https: new https.Agent({
ciphers: crypto.constants.defaultCipherList + ':!ECDHE+SHA:!AES128-SHA',
}),
};
}

try {
return await got(submitUrl, config);
} catch (err) {
Expand Down

0 comments on commit 11dde1e

Please sign in to comment.