HXSecurity / DongTai-agent-java

Java Agent is a Java application probe of DongTai IAST, which collects method invocation data during runtime of Java application by dynamic hooks.

Home Page:https://dongtai.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Weblogic Server start failed

Nizernizer opened this issue · comments

error log:

java.lang.ClassCastException: weblogic.net.http.SOAPHttpsURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection
at io.dongtai.iast.core.utils.HttpClientUtils.sendRequest(HttpClientUtils.java:73)
at io.dongtai.iast.core.utils.HttpClientUtils.sendPost(HttpClientUtils.java:56)
at io.dongtai.iast.core.bytecode.sca.ScaReport.sendReport(ScaReport.java:25)
at io.dongtai.iast.core.bytecode.sca.ScaScanner$ScaScanThread.run(ScaScanner.java:217)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Set parameter a to true to solve the problem:

System.setProperty("UseSunHttpHandler", "true");

fix this bug with code:

import java.net.URL;
...
URL url = new URL(null, baseUrl + urlStr, baseUrl.toLowerCase().startsWith("https://") ? new sun.net.www.protocol.https.Handler() : new sun.net.www.protocol.http.Handler());