Wiremock-请求HTTPS时无法获取响应
我想模拟一个https服务,比如。它的代理和8089端口的邮递员发送。但是,当我尝试获取请求“”时 我得到了Wiremock-请求HTTPS时无法获取响应,https,wiremock,Https,Wiremock,我想模拟一个https服务,比如。它的代理和8089端口的邮递员发送。但是,当我尝试获取请求“”时 我得到了 2019-04-02 17:43:28.291 Opened Socket[addr=/127.0.0.1,port=65409,localport=8089] 2019-04-02 17:43:28.362 Incoming bytes: CONNECT jsonplaceholder.typicode.com:443 HTTP/1.1 cache-control: no-cache
2019-04-02 17:43:28.291 Opened Socket[addr=/127.0.0.1,port=65409,localport=8089]
2019-04-02 17:43:28.362 Incoming bytes: CONNECT jsonplaceholder.typicode.com:443 HTTP/1.1
cache-control: no-cache
User-Agent: PostmanRuntime/7.6.0
Accept: */*
host: jsonplaceholder.typicode.com:443
Connection: close
2019-04-02 17:43:28.363 Closed Socket[addr=/127.0.0.1,port=65409,localport=8089]
2019-04-02 17:43:28.365 Closed Socket[addr=/127.0.0.1,port=65409,localport=8089]
我的wiremock配置如下所示
Mac114361:wiremock-standalone berkay.kirmizioglu$ java -jar wiremock-standalone-2.22.0.jar --enable-browser-proxying --https-port=8089 --port=8080 --record-mappings --verbose=true --proxy-all="https://jsonplaceholder.typicode.com" --print-all-network-traffic
2019-04-02 17:43:22.692 Verbose logging enabled
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2019-04-02 17:43:23.483 Verbose logging enabled
2019-04-02 17:43:23.498 Verbose logging enabled
2019-04-02 17:43:23.541 Recording mappings to ./mappings
/$$ /$$ /$$ /$$ /$$ /$$
| $$ /$ | $$|__/ | $$$ /$$$ | $$
| $$ /$$$| $$ /$$ /$$$$$$ /$$$$$$ | $$$$ /$$$$ /$$$$$$ /$$$$$$$| $$ /$$
| $$/$$ $$ $$| $$ /$$__ $$ /$$__ $$| $$ $$/$$ $$ /$$__ $$ /$$_____/| $$ /$$/
| $$$$_ $$$$| $$| $$ \__/| $$$$$$$$| $$ $$$| $$| $$ \ $$| $$ | $$$$$$/
| $$$/ \ $$$| $$| $$ | $$_____/| $$\ $ | $$| $$ | $$| $$ | $$_ $$
| $$/ \ $$| $$| $$ | $$$$$$$| $$ \/ | $$| $$$$$$/| $$$$$$$| $$ \ $$
|__/ \__/|__/|__/ \_______/|__/ |__/ \______/ \_______/|__/ \__/
port: 8080
https-port: 8089
https-keystore: jar:file:/Users/berkay.kirmizioglu/Documents/wiremock-standalone/wiremock-standalone-2.22.0.jar!/keystore
proxy-all: https://jsonplaceholder.typicode.com
preserve-host-header: false
enable-browser-proxying: true
disable-banner: false
record-mappings: true
match-headers: []
no-request-journal: false
verbose: true
使用HTTPS/SSL时,建议坚持使用端口443。首先,因为当使用https://协议时,大多数HTTP实现都默认使用它,但也因为浏览器或其他HTTP客户端可能不支持不这样做 在您的示例中,您连接到端口443
connectjsonplaceholder.typicode.com:443
,但在端口8090上运行WireMock。更改请求或WireMock端口