0

I have an integration written in Powershell that sends a request to a remote webservice using this line:

$response = Invoke-WebRequest -Uri $uri -Body $xml -Method 'POST' -CertificateThumbprint $CertificateThumbprint

It's been working fine but after replacing the certificate with a new one I changed the thumbprint and got this response: Unable to retrieve certificates because the thumbprint is not valid. Verify the thumbprint and retry.

I've checked that the thumbprint is right. Nothing has changed on the webservice side. The new certificate's properties are the same as the old one's except thumbprint, serienr, valid time and key identifier. The remote side says thay don't need to register the cert since they thrust us.

Does anyone have a clue as to what the problem might be? I have none.

Luscinia
  • 1
  • 1
  • as the message indicates the thumbprint does not match or the certificate is stored at a location where the caller of the script has no access to. what is in the variable $CertificateThumbprint? – Toni Oct 03 '22 at 07:02
  • You may have a cookie that need to be updated since you have a new certificate. Code is still trying to use old certificate due to the cookie. – jdweng Oct 03 '22 at 10:47

0 Answers0