Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.7.3B,全新商户号,为何还会触发到证书校验404的问题呢? #3531

Open
kiddkyd2 opened this issue Mar 21, 2025 · 6 comments

Comments

@kiddkyd2
Copy link

kiddkyd2 commented Mar 21, 2025

我是新微信支付,是否可以完全不配置证书信息,只配置支付公钥?
现在这个库,如果不填写证书参数,又提示没配置证书;
如果填了证书参数,又会触发/v3/certificates的校验404;

是否有什么开关之类的,让接口只走支付公钥的逻辑?

这段代码,在第一部分的逻辑里,就已经404抛异常了,都进不去下面的公钥校验逻辑里。

 private Verifier getVerifier(PrivateKey merchantPrivateKey, WxPayHttpProxy wxPayHttpProxy, PublicKey publicKey) {
    Verifier certificatesVerifier = new AutoUpdateCertificatesVerifier(
      new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
      this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
      this.getPayBaseUrl(), wxPayHttpProxy);
    if (publicKey != null) {
      Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
      publicCertificatesVerifier.setOtherVerifier(certificatesVerifier);
      certificatesVerifier = publicCertificatesVerifier;
    }
    return certificatesVerifier;
  }
@binarywang
Copy link
Owner

@SynchPj 麻烦看下这个问题

@xiaoliu10
Copy link

我也遇到相同的问题

@Yohuaye
Copy link

Yohuaye commented Mar 28, 2025

反过来试试,先验证公钥,后获取平台证书。微信好像不再提供平台证书下载了。

我是新微信支付,是否可以完全不配置证书信息,只配置支付公钥? 现在这个库,如果不填写证书参数,又提示没配置证书; 如果填了证书参数,又会触发/v3/certificates的校验404;

是否有什么开关之类的,让接口只走支付公钥的逻辑?

这段代码,在第一部分的逻辑里,就已经404抛异常了,都进不去下面的公钥校验逻辑里。

 private Verifier getVerifier(PrivateKey merchantPrivateKey, WxPayHttpProxy wxPayHttpProxy, PublicKey publicKey) {
    Verifier certificatesVerifier = new AutoUpdateCertificatesVerifier(
      new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
      this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
      this.getPayBaseUrl(), wxPayHttpProxy);
    if (publicKey != null) {
      Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
      publicCertificatesVerifier.setOtherVerifier(certificatesVerifier);
      certificatesVerifier = publicCertificatesVerifier;
    }
    return certificatesVerifier;
  }

@SynchPj
Copy link
Contributor

SynchPj commented Mar 31, 2025

#3530 相同问题,已解决

@binarywang
Copy link
Owner

#3530 相同问题,已解决

还没提交PR吧?!

@liuwenfeng554
Copy link

liuwenfeng554 commented Mar 31, 2025

#3530 相同问题,已解决

Image 同时配置平台证书和支付公钥 这里会不会就有问题,一般灰度测试要两者都支持 @SynchPj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants