aboutsummaryrefslogtreecommitdiff
path: root/src/utils/networkUtils.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-09-23 17:56:38 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-09-23 17:56:38 +0800
commita38700b5ae8822f159c7457d4d67e53f75ca63fa (patch)
tree13097a8f1a5e1e3b71a0948f9b876e6ec3d1c600 /src/utils/networkUtils.js
parent644a192508dba2719c24ecd3c0b3295120b0fbb5 (diff)
downloadSoopyV2-a38700b5ae8822f159c7457d4d67e53f75ca63fa.tar.gz
SoopyV2-a38700b5ae8822f159c7457d4d67e53f75ca63fa.tar.bz2
SoopyV2-a38700b5ae8822f159c7457d4d67e53f75ca63fa.zip
Support lets encript prepairing for hypixel api change
Diffstat (limited to 'src/utils/networkUtils.js')
-rw-r--r--src/utils/networkUtils.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/networkUtils.js b/src/utils/networkUtils.js
index 41d27e5..5ac95a4 100644
--- a/src/utils/networkUtils.js
+++ b/src/utils/networkUtils.js
@@ -1,3 +1,5 @@
+import socketFactory from "./letsEncryptCerts"
+
if (!global.networkUtilsThingSoopyPromise) {
let jURL = Java.type("java.net.URL")
@@ -6,6 +8,7 @@ if (!global.networkUtilsThingSoopyPromise) {
let jBufferedReader = Java.type("java.io.BufferedReader")
let jInputStreamReader = Java.type("java.io.InputStreamReader")
let jString = Java.type("java.lang.String")
+ var JHttpsUrlConnection = Java.type('javax.net.ssl.HttpsURLConnection');
function getUrlContent(theUrl, { userAgent = "Mozilla/5.0", includeConnection = false, postData = undefined } = {}) {
@@ -19,6 +22,9 @@ if (!global.networkUtilsThingSoopyPromise) {
// Thread.sleep(1000) //simulating high ping
let conn = new jURL(theUrl).openConnection()
+ if (conn instanceof JHttpsUrlConnection) {
+ conn.setSSLSocketFactory(socketFactory);
+ }
conn.setRequestProperty("User-Agent", userAgent)
if (postData) {