今天在测试微信退款的时候报的错:
org.apache.http.NoHttpResponseException: api.mch.weixin.qq.com:443 failed to respond at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:141) at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56) at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) at com.github.wxpay.sdk.WXPayRequest.requestOnce(WXPayRequest.java:108) at com.github.wxpay.sdk.WXPayRequest.request(WXPayRequest.java:127) at com.github.wxpay.sdk.WXPayRequest.requestWithCert(WXPayRequest.java:296) at com.github.wxpay.sdk.WXPay.requestWithCert(WXPay.java:207) at com.github.wxpay.sdk.WXPay.refund(WXPay.java:532) at com.github.wxpay.sdk.WXPay.refund(WXPay.java:510)
我原本以为是网络问题,于是我决定telnet一下
C:\Users\admin>telnet api.mch.weixin.qq.com 443
貌似没有啥问题。
忽然我就想到了:
我是做的退款操作,退款操作要证书!我没有下载证书!!!!
所以爆这个异常,你要是确定你的网络没问题,基本上就是没能加载到证书了。