The certification authority service does not start and throws the error message "The parameter is incorrect. 0x80070057 (WIN32: 87 ERROR_INVALID_PARAMETER)"

Assume the following scenario:

  • A certification authority is implemented in the network.
  • The certification authority service does not start.
  • When trying to start the certification authority service, you get the following error message:
The parameter is incorrect. 0x57 (WIN32: 87 ERROR_INVALID_PARAMETER)

Error dialog "Microsoft Active Directory Certificate Services": The parameter is incorrect. 0x57 (WIN32: 87 ERROR_INVALID_PARAMETER)

A corresponding event no. 100 can also be found in the Event Viewer of the certification authority:

Active Directory Certificate Services did not start: Could not load or verify the current CA certificate. FabrikamRootCA The parameter is incorrect. 0x80070057 (WIN32: 87 ERROR_INVALID_PARAMETER).

Event 100, CertificationAuthority: Active Directory Certificate Services did not start, The parameter is incorrect. 0x80070057 (WIN32: 87 ERROR_INVALID_PARAMETER)

Cause

Do you know TameMyCerts? TameMyCerts is an add-on for the Microsoft certification authority (Active Directory Certificate Services). It extends the function of the certification authority and enables the application of rule sets to realize the secure automation of certificate issuance. TameMyCerts is unique in the Microsoft ecosystem, has already proven itself in countless companies around the world and is available under a free license. It can be downloaded via GitHub and used free of charge. Professional maintenance is also offered.

Usually, the error is due to the fact that there is a problem with the CACertHash registry value of the certification authority.

This is located in the following path:

HKLM\System\CurrentControlSet\Services\CertSvc\Configuration\{Common-Name-der-Zertifizierungsstelle}

Registry Editor: context menu "Modify..." of the CACertHash value under CertSvc, Configuration

CACertHash contains invalid thumbprints

The error may occur if the CACertHash value contains invalid (e.g.: incomplete) thumbprints.

Dialog "Edit Multi-String": value name CACertHash, value data starts with a 4 marked in yellow

CACertHash contains hidden control character

The error occurred in the example because the registry value CACertHash could not be read. Here a thumbprint value was replaced , copying an invisible character into the registry value "CACertHash".

You can check this with the following command line command:

certutil -getreg CA\CaCertHash

Command prompt: certutil -getreg ca\cacerthash shows CACertHash REG_MULTI_SZ, "CertUtil: -getreg command completed successfully."

When copying the thumbprint from the certificate dialog, a space often creeps in that you don't see in Regedit or the text editor.

Certificate dialog, "Details" tab: thumbprint 0126868d989bd79e7db9228b4d6d0717ed43a25a selected

It is therefore advisable to type in the thumbprint for such an operation or to determine it from another source, such as Windows PowerShell. In Windows PowerShell, this can be done using the Get-ChildItem command.

For machine certificates:

Get-ChildItem -Path Cert:\LocalMachine\My

For user certificates:

Get-ChildItem -Path Cert:\CurrentUser\My

PowerShell: Get-ChildItem -Path Cert:\LocalMachine\My lists thumbprint 0126868D... with subject CN=ADCS Labor Test Root