Slackbot
03/28/2023, 4:58 PMTom
03/28/2023, 7:21 PM.enableBrowserProxying(true)
in the Java startup options, or --enable-browser-proxying
from the CLI.Steve Teplica
03/30/2023, 3:43 PM-Dhttps.proxyHost=localhost
-Dhttps.proxyPort=1083
-Dhttps.nonProxyHosts=
Changes to WireMock Server:
• I configured WireMock’s HTTPS port to 1083
• I added a ConsoleNotifyingWiremockNetworkTrafficListener
to log info on incoming/outgoing network traffic.
• These are the current relevent WireMock configurations:
WireMockServer wireMockServer = new WireMockServer(WireMockConfiguration.options()
.port(1080)
.httpsPort(1083)
.enableBrowserProxying(true)
.trustAllProxyTargets(true)
.preserveHostHeader(true)
...
)
Observed behavior:
• It looks like the initial HTTP CONNECT request (to open a tunnel to client’s request destination) is closing prematurely or failing:
2023-03-29 16:25:53.924 Opened Socket[addr=/127.0.0.1,port=53213,localport=1083]
2023-03-29 16:25:53.930 Incoming bytes: CONNECT <http://subdomain.domain.com:443|subdomain.domain.com:443> HTTP/1.1
Host: <http://subdomain.domain.com:443|subdomain.domain.com:443>
Proxy-Connection: Keep-Alive
User-Agent: okhttp/3.8.1
2023-03-29 16:25:53.938 Outgoing bytes: P
2023-03-29 16:25:53.943 Closed Socket[unconnected]
@Tom Do you have any advice for debugging this further? Or does this appear as an obvious symptom, to you, of something being misconfigured? Any help is greatly appreciated 😄Steve Teplica
03/30/2023, 3:49 PM<http://subdomain.domain.com|subdomain.domain.com>
. This is an endpoint that can only be reached while on my corporate network (I’m VPN’d in). The spring application normally sends these requests directly to that endpoint. The spring application does have a keystore and a truststore. I’m not sure if/how those should be used from WireMockSteve Teplica
03/30/2023, 6:32 PMTom
03/31/2023, 10:00 AMTom
03/31/2023, 10:02 AMSteve Teplica
04/03/2023, 4:24 PMhttp.proxyPort
and https.proxyPort
to the same port. So I did the same thing for my spring app, and then everything was working!