我正在编写一个内部使用 WireMock 的 HTTP 记录播放代理,并且在记录 HTTPS 目标时遇到问题。HTTP 站点工作正常。
以下是我为未加密站点设置 WireMock 代理的方法:
java \
-jar /var/proximate/wiremock-standalone-2.4.1.jar \
--port 9000 \
--proxy-all http://ilovephp.jondh.me.uk \
--record-mappings \
--root-dir /remote/experiment/record/http
然后,我可以使用以下命令在该站点上记录任何内容:
wget -e use_proxy=yes -e http_proxy=proximate-proxy:9000 \
http://ilovephp.jondh.me.uk/en/tutorial/make-your-own-blog
很快,我将获得一些自动创建的映射:
/ # ls -R /remote/experiment/record/http
/remote/experiment/record/http:
__files mappings
/remote/experiment/record/http/__files:
body-tutorial-make-your-own-blog-tWrNm.txt
/remote/experiment/record/http/mappings:
mapping-tutorial-make-your-own-blog-tWrNm.json
这是相同的事情,但在 SSL 站点上。代理优先:
java \
-jar /var/proximate/wiremock-standalone-2.4.1.jar \
--port 9000 \
--proxy-all https://www.rottentomatoes.com/ \
--record-mappings \
--root-dir /remote/experiment/record/https \
--verbose
这是获取:
wget -e use_proxy=yes -e http_proxy=proximate-proxy:9000 \
https://www.rottentomatoes.com/
WireMock 的结果是创建了内部缓存目录,但它们不包含任何内容:
/ # ls -R /remote/experiment/record/https
/remote/experiment/record/https:
__files mappings
/remote/experiment/record/https/__files:
/remote/experiment/record/https/mappings:
我在 Docker 容器中的 Alpine 3.4 上使用 WM 2.4.1。我是否需要使用某些https
特定的命令行开关才能使其正常工作?
更新
看到最近的2.5.0版本最近合并了,我暂时感到欣慰https-bind-address-bug
,这听起来非常相关。我已经尝试过这个版本,但不幸的是它没有任何区别。