Pauls Jakovels
Pauls Jakovels

Reputation: 1

C# CommunicationsClientBuilder not seeing a local certificate by its thumbprint

Executing the code outside of Azure (locally). The code is simple, replaced app id and name with foos:

            var mediaPlatformSettings = new MediaPlatformSettings()
            {
                MediaPlatformInstanceSettings = new MediaPlatformInstanceSettings()
                {
                    CertificateThumbprint = "52d85f98750cee735caba5d9e128c5ff64436d9a",
                    InstanceInternalPort = 80,
                    InstancePublicIPAddress = IPAddress.Any,
                    InstancePublicPort = 80,
                    ServiceFqdn = "mupse.pupse.com"
                },
                ApplicationId = "foo-id"
            };

            var builder = new CommunicationsClientBuilder(
                "foo",     // name
                "foo-id", // app id
                this.Logger);
            builder.SetMediaPlatformSettings(mediaPlatformSettings);

Getting error at the last line:

ArgumentException: CertificateThumbprint
Parameter name: Could not find a matching certificate for thumbprint 52d85f98750cee735caba5d9e128c5ff64436d9a

Certificate is self-signed, in pfx format, together with its private key. It is installed with MMC utility in Personal folder. It's rootCA is installed in Trusted Root Certificates folder; MMC doesn't report it as unsafe.

Relevant certificate properties, as per MMC:

So, both CN and thumbprint matches between what is in store and what is in code.

Other things tried:

Expected result: exception should not happen and media platform should be configured properly.

Upvotes: 0

Views: 54

Answers (1)

Pauls Jakovels
Pauls Jakovels

Reputation: 1

Problem was solved by installing certificate on machine account. The program itself was launched by a users account, btw.

Upvotes: 0

Related Questions