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.
https://dongtai.io
Apache License 2.0
681 stars 191 forks source link

[Bug] Weblogic Server start failed #252

Closed Nizernizer closed 2 years ago

Nizernizer commented 2 years ago

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");
exexute commented 2 years ago

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());