I am currently unable to renew my Lync Server 2013 OAuth certificate.
Assigning this through the wizard or shell completes without any errors but the new certificate is not shown in the wizard or shell and an event is logged under the replication service to say that the replication failed.
This appears to be the same error reported in http://social.technet.microsoft.com/Forums/lync/en-US/6e4b15f7-16a2-48d9-9cbe-1fc3ff8cf432/lync-server-2013-rtm-cannot-assign-oauth-certificate?forum=lyncdeploy and I've copied this in below.
The replication of certificates from the central management store to the local machine failed due to a problem with certificate processing or installation on the local machine Microsoft Lync Server 2013, Replica Replicator Agent will continuously attempt to retry the replication. While this condition persists, the certificates on the local machine will not be updated.
Exception: Microsoft.Rtc.Management.Common.Certificates.CertificateException: Keyset does not exist
---> System.Security.Cryptography.CryptographicException: Keyset does not exist
at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()
at Microsoft.Rtc.Management.Common.Certificates.CertAccessRule.CAPIModifyAccessRule(X509Certificate2 certificate, AccessRule rule, Boolean addRule)
--- End of inner exception stack trace ---
at Microsoft.Rtc.Management.Common.Certificates.CertAccessRule.CAPIModifyAccessRule(X509Certificate2 certificate, AccessRule rule, Boolean addRule)
at Microsoft.Rtc.Management.Common.Certificates.CertAccessRule.ModifyAccessRule(X509Certificate2 certificate, AccessRule rule, Boolean addRule)
at Microsoft.Rtc.Management.Common.Certificates.CertUtils.AddCertificateToStore(X509Certificate2 cert, StoreName storeName, IManagementReporter reporter)
at Microsoft.Rtc.Management.Deployment.Core.Certificate.ImportFromPinnedArray(PinnedByteArray pfx, Boolean allowSelfSigned)
at Microsoft.Rtc.Management.Deployment.Core.Certificate.ReplicateCMSCertificates(IScopeAnchor scope)
at Microsoft.Rtc.Internal.Tools.Bootstrapper.Bootstrapper.ReplicateCMSCertificates().
Cause: The certificate provisioned in the central management store is invalid or cannot be handled on the local machine.
Resolution:
Ensure that certificates provisioned in the central management store are valid, have all needed issuer certificates included or installed on the local machine, and can be used with cryptographic providers available on the local machine.
There was a certificate in place for this previously but this issue was shown when trying to renew the existing certificate. I then removed the existing certificate and tried to add the new one but had the same issue. I also had the same issue when trying
to re-import the certificate which was previously in use.
I have tried renewing through the Lync wizard and directly through the CA.
I have tested replication using get-csmanagementstorereplicationstatus which shows no issues.
There is only one front end server in the topology which is on Server 2012. The edge server is not using this certificate.
I have also tried using the domain wildcard certificate which has the same issue.
I'll update this with more detail and clarity if I can.
Thanks in advance!
Matt