我正在尝试调用第三方服务,但我收到消息“System.CalloutException:DER 输入,整数标记”。第三方为我们提供了自签名的客户端证书以供使用。我看到了那里的迹象(例如,在这里和APEX 文档中,这可能使用带有 setClientCertificate 的“旧”方法,尽管我意识到这些是我没有使用的 SOAP 示例。
我已将证书转换为 Base64。我的代码如下。任何帮助,将不胜感激。
HttpRequest req = new HttpRequest();
req.setEndpoint('https://myurl');
req.setMethod('POST');
string cert = 'mybase64encodedcert';
string certpass = 'mycertpass';
req.setClientCertificate(cert,certpass);
string thebody = 'somebody';
req.setBody(thebody);
Http http = new Http();
HTTPResponse res = http.send(req);
顺便说一句,我已阅读有关客户端证书的 APEX 文档和所有参考材料。我不认为我正在做文档中涵盖的事情。