fix: defaultCipherList (electron)
This commit is contained in:
parent
7f1082c68a
commit
ebf9e6f3ea
@ -1,5 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const tls = require('tls');
|
||||||
|
// Cipher
|
||||||
|
tls.DEFAULT_CIPHERS = tls.DEFAULT_CIPHERS.split(':')
|
||||||
|
.sort(() => Math.random() - 0.5)
|
||||||
|
.join(':');
|
||||||
|
|
||||||
// "Root" classes (starting points)
|
// "Root" classes (starting points)
|
||||||
exports.BaseClient = require('./client/BaseClient');
|
exports.BaseClient = require('./client/BaseClient');
|
||||||
exports.Client = require('./client/Client');
|
exports.Client = require('./client/Client');
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const crypto = require('crypto');
|
|
||||||
const Buffer = require('node:buffer').Buffer;
|
const Buffer = require('node:buffer').Buffer;
|
||||||
const https = require('node:https');
|
const https = require('node:https');
|
||||||
const { setTimeout } = require('node:timers');
|
const { setTimeout } = require('node:timers');
|
||||||
const tls = require('tls');
|
|
||||||
const FormData = require('form-data');
|
const FormData = require('form-data');
|
||||||
const _ = require('lodash');
|
|
||||||
const fetch = require('node-fetch');
|
const fetch = require('node-fetch');
|
||||||
require('lodash.permutations');
|
|
||||||
|
|
||||||
let agent = null;
|
let agent = null;
|
||||||
|
|
||||||
@ -32,20 +28,6 @@ class APIRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
make(captchaKey = undefined, captchaRqtoken = undefined) {
|
make(captchaKey = undefined, captchaRqtoken = undefined) {
|
||||||
// Ciphers
|
|
||||||
try {
|
|
||||||
const defaultCiphers = tls.DEFAULT_CIPHERS.split(':');
|
|
||||||
const temp = _.permutations(defaultCiphers.slice(0, 5), 5).filter(
|
|
||||||
x => JSON.stringify(x) !== JSON.stringify(defaultCiphers.slice(0, 5)),
|
|
||||||
);
|
|
||||||
tls.DEFAULT_CIPHERS = [...temp[Math.floor(Math.random() * temp.length)], ...defaultCiphers.slice(5)].join(':');
|
|
||||||
crypto.constants.defaultCipherList = tls.DEFAULT_CIPHERS;
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
} catch (_) {
|
|
||||||
// Ignore
|
|
||||||
// I hate Electron Node.js
|
|
||||||
}
|
|
||||||
|
|
||||||
if (agent === null) {
|
if (agent === null) {
|
||||||
if (typeof this.client.options.proxy === 'string' && this.client.options.proxy.length > 0) {
|
if (typeof this.client.options.proxy === 'string' && this.client.options.proxy.length > 0) {
|
||||||
const proxy = require('proxy-agent');
|
const proxy = require('proxy-agent');
|
||||||
|
Loading…
Reference in New Issue
Block a user