收藏
回答

Failed to connect to api.mch.weixin.qq.com?

window 开发环境正常,部署到linux 启动无法正常访问 

com.wechat.pay.java.core.exception.HttpException: Send Http Request failed,httpRequest[{"http_method":"GET","url":"https://api.mch.weixin.qq.com/v3/certificates?algorithm_type=RSA","uri":"https://api.mch.weixin.qq.com/v3/certificates?algorithm_type=RSA","headers":{"headers":{}}}]

at com.wechat.pay.java.core.http.okhttp.OkHttpClientAdapter.innerExecute(OkHttpClientAdapter.java:52)

at com.wechat.pay.java.core.http.AbstractHttpClient.execute(AbstractHttpClient.java:44)

at com.wechat.pay.java.core.certificate.CertificateDownloader.download(CertificateDownloader.java:81)

at com.wechat.pay.java.core.certificate.AutoCertificateService.lambda$register$0(AutoCertificateService.java:66)

at com.wechat.pay.java.core.certificate.AutoCertificateService$$Lambda$1020/1741618564.run(Unknown Source)

at com.wechat.pay.java.core.certificate.AutoCertificateService.register(AutoCertificateService.java:72)

at com.wechat.pay.java.core.certificate.RSAAutoCertificateProvider.<init>(RSAAutoCertificateProvider.java:40)

at com.wechat.pay.java.core.certificate.RSAAutoCertificateProvider.<init>(RSAAutoCertificateProvider.java:19)

at com.wechat.pay.java.core.certificate.RSAAutoCertificateProvider$Builder.build(RSAAutoCertificateProvider.java:134)

at com.wechat.pay.java.core.RSAAutoCertificateConfig$Builder.build(RSAAutoCertificateConfig.java:117)

at com.westar.core.config.WechatPayConfig.payConfig(WechatPayConfig.java:32)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)

... 61 common frames omitted

Caused by: java.net.ConnectException: Failed to connect to api.mch.weixin.qq.com/240e:e1:aa00:4000:0:0:0:94:443

at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:265)

at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183)

at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)

at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)

at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)

at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169)

at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)

at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)

at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)

at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)

at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)

at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)

at okhttp3.RealCall.execute(RealCall.java:81)

at com.wechat.pay.java.core.http.okhttp.OkHttpClientAdapter.innerExecute(OkHttpClientAdapter.java:49)

... 76 common frames omitted

Caused by: java.net.ConnectException: Network is unreachable

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at okhttp3.internal.platform.Platform.connectSocket(Platform.java:130)

at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:263)

... 95 common frames omitted


回答关注问题邀请回答
收藏

3 个回答

  • 闫耐
    闫耐
    12-05

    把你的梯子关了就好了。微信拦截梯子代理访问

    12-05
    有用
    回复
  • Leo
    Leo
    11-29

    大神这个问题解决了吗?我也碰到这个问题了

    11-29
    有用
    回复
  • Mr.Zhao
    Mr.Zhao
    发表于小程序端
    08-19

    跟linux没关系吧,用wsl部署也报错?

    08-19
    有用
    回复
登录 后发表内容