生成签名的时候,openssl_sign返回false,这是什么原因导致的呢
$url_parts = parse_url($url);
3
$canonical_url = ($url_parts['path'] . (!empty($url_parts['query']) ? "?${url_parts['query']}" : ""));
4
$message = $http_method."\n".
5
$canonical_url."\n".
6
$timestamp."\n".
7
$nonce."\n".
8
$body."\n";
9
10
openssl_sign($message, $raw_sign, $mch_private_key, 'sha256WithRSAEncryption');
11
$sign = base64_encode($raw_sign);
12
13
$schema = 'WECHATPAY2-SHA256-RSA2048';
14
$token = sprintf('mchid="%s",nonce_str="%s",timestamp="%d",serial_no="%s",signature="%s"',
15
$merchant_id, $nonce, $timestamp, $serial_no, $sign);
这个openssl_sign中的$mch_private_key是要使用服务商的私钥,还是子商户的私钥呢