| Previous | Next |
| MQ_ERROR_ENCRYPTION_PROVIDER_NOT_SUPPORTED | MQ_ERROR_CERTIFICATE_NOT_PROVIDED |
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR
Why the exact HRESULT matters
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR belongs to the Message Queuing HRESULT facility, but its useful meaning is narrower than a generic messaging failure. The result marks key-container security descriptor update failed. MSMQ could not establish permissions on private cryptographic material for the intended user.
For MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, encryption capability and message authentication are related but distinct. When diagnosing MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, preserve provider, algorithm, certificate, key-container, and queue authentication/privacy settings rather than collapsing them into one “SSL” diagnosis.
When diagnosing MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, authenticated MSMQ messages combine a sender identity, certificate, private key, hash/signature algorithm, and queue policy. In the MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR path, successful certificate parsing does not prove that the key is accessible to the sending process.
Subsystem context
| Subsystem | MSMQ message authentication, certificate registration, signing, hashing, and encryption |
|---|---|
| Decisive boundary | certificate identity, key availability, provider capability, and message policy are independent checks |
| Code-specific focus | key-container security descriptor update failed |
| Primary recovery rule | Inspect key-container ACLs and profile identity without broadening access to Everyone. |
When diagnosing MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, queue ACLs, certificate trust, private-key access, provider support, and destination authentication policy are independent. Test the layer named by the evidence. For MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, the code-specific boundary is key-container security descriptor update failed.
Minimum useful telemetry
- Certificate store location and security identity used by the process; associate it explicitly with
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR. - When diagnosing
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, provider name/type, hash algorithm, and privacy/authentication properties; capture the value before cleanup or retry changes it. - In the
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCRpath, whether the failure occurred while preparing, sending, storing, or validating the message; compare it with a known-good call using the same account and queue type. - For this
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCRresult, record the queue path or format name, local/remote placement, transactional flag, caller SID, process build, and UTC correlation ID when they apply.
For MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, log certificate thumbprints, provider names, SIDs, GUIDs, lengths, and hashes where useful, but do not log private keys, symmetric keys, credentials, or confidential message bodies.
Step-by-step diagnosis
- Record the unsigned HRESULT,
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, and the native API or COM method before a framework replaces it with a generic exception. - When diagnosing
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, capture certificate store location and security identity used by the process. - In the
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCRpath, capture provider name/type, hash algorithm, and privacy/authentication properties. - Reproduce with the smallest queue/message/property set that still returns
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR; change one precondition at a time. - For
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, verify the postcondition after the failed call: queue existence, message presence, directory object state, transaction outcome, or generated output may differ by result. - When diagnosing
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, apply the code-specific recovery rule: Inspect key-container ACLs and profile identity without broadening access to Everyone.
Retry and cleanup
Inspect key-container ACLs and profile identity without broadening access to Everyone.
When diagnosing MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, retry only after a measurable state change: corrected property data, resized storage, restored service/directory reachability, recreated handle, completed transaction recovery, or repaired certificate access. In the MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR path, bound attempts and keep an idempotency key for sends or directory mutations.
Avoiding a false diagnosis
In the MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR path, authentication failure is not synonymous with queue access denial. For this MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR result, certificate stores, private keys, providers, signatures, and queue policy must be tested separately. The specific focus for MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR remains key-container security descriptor update failed.
- In the
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCRpath, A successful test under an interactive administrator account does not prove that the production service account has the same profile, token, directory access, or key permissions. - For this
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCRresult, restarting MSMQ before collecting evidence can invalidate handles and erase the first useful event; it is a containment action, not a root-cause diagnosis.
Example
A certificate-registration utility encounters MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR. For MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, it tests store and private-key access under the production identity before changing queue security. When diagnosing MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, the acceptance test then changes only the decisive precondition and confirms both the HRESULT and the actual queue/message state.
For MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCR, include a negative test for the nearest misleading diagnosis so monitoring and user guidance do not collapse distinct MSMQ failures into one alert.
References
- Microsoft: Message Queuing error and information codes — source used for the
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCRanalysis. - Microsoft: authenticated MSMQ message with an external certificate — source used for the
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCRanalysis. - Microsoft: MSMQMessage object and message properties — source used for the
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCRanalysis. - Microsoft: Windows certificate stores — source used for the
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCRanalysis. - IETF RFC 5280: Internet X.509 PKI certificate profile — source used for the
MQ_ERROR_CANNOT_SET_CRYPTO_SEC_DESCRanalysis.
Looking for a different code? Search another status or error code.