v3支付构建httpclient时报错“下载平台证书返回状态码异常,状态码为:401”
代码如下: PrivateKey merchantPrivateKey = PemUtil.loadPrivateKey(paymentConfig.getMchPrivateKey());
WechatPay2Credentials credentials = new WechatPay2Credentials(
paymentConfig.getMchId(), new PrivateKeySigner(paymentConfig.getMchSerialNo(), merchantPrivateKey));
byte[] bytes = paymentConfig.getMchV3Key().getBytes(StandardCharsets.UTF_8);
CertificatesManager certificatesManager = CertificatesManager.getInstance();
certificatesManager.putMerchant(paymentConfig.getMchId(), credentials, bytes);
paymentConfig为支付配置对象,运行到最后一行时报错提示:下载平台证书返回状态码异常,状态码为:401,相关配置由管理人员提供,已基本确认非配置错误,目前网络上暂无相关资料