参考资料
问题解决
异步返回解密失败
- 这个支付返回异步通知在本机可正确解密,但是服务器上解密失败。
1
2
3
4
5
6
解析付款通知出错:支付通知回调,验签、解密失败--->Processing WechatPay notification,signature verification failed,signType[WECHATPAY2-SHA256-RSA2048] serial[***] message[1727406002
DcQqYFLpu2R7SEYz4mH9bDbtoaPlkexC
{"id":"13bfc133-d1be-5b53-8b90-388863c93e03","create_time":"2024-09-27T10:59:55+08:00","resource_type":"encrypt-resource","event_type":"MCHTRANSFER.BATCH.FINISHED","summary":"鍟嗗杞处鎵规瀹屾垚閫氱煡","resource":{"original_type":"mch_payment","algorithm":"AEAD_AES_256_GCM","ciphertext":"JoUNycXeCGxbi+ptvs1o4lFlwMdvtuzwStCafdPqmjOE0YZyqZNlJtXeM03EYG+PmjRYevDQtP/l6IhOCoMDGYIBGfRaKT2WrF+81s0VyIqtVaFau0phz4gisangLIA2NMu5OSIHAOhau42NtWvwpPxOO9L6ImQg800qNq9ZthLMSBJ5qJMU5qj1MbdTuHLw8a/BdZ/o62HdJrrsHbRlx9MqYHIJca+ZCFxRAjJOzj0XlltkBUPnavxMCyvDdYi80/PyazIE/z2u7RdzIUBpb8inmVMRfu9raGc289qqMRWUL6AggxNQc/K2PdImBq+aNPUE2/Kze7TcqL6wd1TvNqYDDrRHLd81VpTZm7+ChCjwW+upfZKiC/8BpO03zUZ67Q37ubC7SdSKaUN98/F777Gdx2IbbX8X16iRGOGOhxsoXqobLuGqRfmA6ruo","associated_data":"mch_payment","nonce":"ZpKjEmbKoTZt"}}
] sign[BgLPsyZDaqGM2ObRYaiYjEqwWg+8gpxeWJvhxjRzhyzQh36Xbx6Ff+Rj8urrSSMpEU0/fSjw+GLiFH5wD5Ldf2tnQW520TEWPafMEJNE0cQkKqP8iWT3tkoU+tXclhjYL7XQj1KyU/3MaZ8z0Eb2q7x7iuGWuGX3ANz14skL7jo+tzdL9nx37XlbKiEjXJiOU6kQNhj4jAacqisIj5yGx2zgvGFDsE0DvawbjwdYQFnX9hUZMrEQJINmReQ4alKAW4TShCkxpATGOUaRlRMvcs3gvqJ+bVJJBd6Zrb4IOE7XwmGhKY7vjYBXfQUaYQiaaXM7qTqiwcyvR1LGmRZTvQ==]
解决思路
依次排查 nginx、request params、request body、配置文件编码、jdk版本、java运行编码最终确认问题是java运行spring boot的编码问题。
对比方式
运行命令中添加编码 -Dfile.encoding=utf-8
1 | java -Dfile.encoding=utf-8 -jar %JAVA_JAR% --server.port=18085 --spring.profiles.active=prd |
完结