1. How can I troubleshoot a signature mismatch error?
1. How can I troubleshoot a signature mismatch error?
If the SignatureDoesNotMatch error message is returned, a signature error has occurred.
Follow these steps for troubleshooting:
- Verify that the AccessKey does not have extra spaces.
- When the request header contains Content-MD5, the StringToSign must contain the MD5 value of the requested content data that uses Base64 encoding.
- Verify that the Content-Type is the same as the Content-Type in the HTTP header. The Content-Type indicates the type of the content requested.
- Verify that the Date is the same as the Data in the HTTP header and is using one of the GMT formats supported by HTTP1.1. Note that the interval between the time you send the request (client-side system time) and the time when the server receives the request must not exceed 15 minutes. If the interval exceeds 15 minutes, the system considers the request is invalid and returns an error. Verify that the system time on the request sender is the standard time.
- Verify that the CanonicalizedKssHeaders is the Header combinations starting with x-kss in the HTTP request.
- Verify that the CanonicalizedResource is the resource that you want to access.
- Verify that the signature meets the signature construction rules. For more information, see Request signature.
As a best practice, use an SDK for signature. You can use the SDK for Java, PHP, Python, Android, IOS, JavaScript, Node.js, C#, GO, or C/C++