wechatpay-apiv3/wechatpay-java

将pem文件放到resources下,RSAAutoCertificateConfig无法读取到配置文件

Astrsea opened this issue · 1 comments

错误描述

将pem文件放到resources下,RSAAutoCertificateConfig无法读取到配置文件

重现bug的步骤

1.将pem文件放在resources下
屏幕截图 2024-01-19 124654
2.springboot.yml配置pem文件的路径
2
3.创建配置文件的实体类对象
3
4.RSAAutoCertificateConfig中传入配置对象
4

预期行为

不论是否在配置是否为private-key-path: apiclient_key.pem或者private-key-path: classpath:apiclient_key.pem,打包成jar包后,在linux环境运行时都会出现无法读取到pem文件的问题

导致错误的代码片段

return new RSAAutoCertificateConfig.Builder()
.merchantId(wxProperty.getMchId())
.privateKeyFromPath(wxProperty.getPrivateKeyPath())
.merchantSerialNumber(wxProperty.getMchSerialNo())
.apiV3Key(wxProperty.getApiV3Key())
.build();

操作系统

Linux

Java 版本

java 17

wechatpay-java 版本

0.2.12

其他信息

No response