我遵循此Article来实现混合应用程序的证书固定。该解决方案适用于Android,但我看到iPhone的以下问题。
err: {"responseHeaders":{},"status":0,"responseText":"","errorCode":"UNEXPECTED_ERROR","errorMsg":"The operation couldn’t be completed. (NSURLErrorDomain error -1012.)","invocationContext":null}
我完全按照文章中的说明实现了。我使用了此代码示例here
中提到的.der格式 // This API method must be called before any request attempt.
WL.Client.pinTrustedCertificatePublicKey('MyCert.der').then(successfulPinning,failedPinning);
}
//Enable the buttons that send a request.
function successfulPinning() {
WL.Logger.error("Certificate pinned");
}
function failedPinning() {
WL.Logger.error("Certificate not pinned");
}