httptoolkit / jvm-http-proxy-agent

A JVM agent that automatically forces a proxy for HTTP(S) connections and trusts MitM certificates, for all major JVM HTTP clients
Apache License 2.0
71 stars 22 forks source link

Agent can't intercept WildFly / JBoss server #12

Open pimterry opened 2 years ago

pimterry commented 2 years ago

I tried the .jar with my change on a demo project using Spring Boot and everything worked fine. After, I tried the same project in .war + Wildfly 26.0.1.Final and I was able to replicate the ClassNotFoundException bug. Same JDK.

So I searched and I found that you should start Wildfly with -Djboss.modules.system.pkgs=tech.httptoolkit to be able to attach the agent in a running Wildfly... Not sure if we can bypass it in HTTP Toolkit.

Originally posted by @davidhsv in https://github.com/httptoolkit/jvm-http-proxy-agent/issues/2#issuecomment-1203084786

pimterry commented 2 years ago

@davidhsv Good find! This is very interesting indeed.

If possible, it would be great to not just warn about this issue but to even automatically fix it (by setting that option ourselves) but I imagine that's not possible? If this needs to be set at startup time, for a process that we only attach to later on, then clearly there's nothing we can do there.

Given that, I'd happily accept a PR that explicitly fails to attach and logs a helpful message when attaching to a Wildfly server that's not usable.