Blue_PowerRanger
Blue_PowerRanger

Reputation: 1

Add Service Refrence in VS19 that requires authentication with client certificate

How do I add a Connected Service that requires a Certificate?

I need to call a SOAP API developed by another company. The company has supplied me with a pfx-file based on a cer-file I've created. I've installed the certificate in "Trusted Root Certification Authorities" (in local computer and current user) using the supplied password. But when i try to add a WCF Web Service Provider either through the URL or the wsdl-file I get the error: "Could not create SSL/TLS secure channel", and the addition of the service is abandoned.

When I contacted the company they asked me to check if the certificate was installed correctly by calling the API from SOAP UI (adding a jks-file they gave me) - this works fine. They could not be of further assistance.

I'm writing a aps.net core web application and using .net core 3.0 in VS19

I'll have to mention that this is my first practical encounter with certificates and the question might be somewhat in concise.

Upvotes: 0

Views: 66

Answers (1)

Daniel Fisher  lennybacon
Daniel Fisher lennybacon

Reputation: 4184

The PFX might contain more than one certificate.

Are you shure you created a .cer (Certificate) and not a .csr (Certificate signing request)?

Nonetheless, the certificate must be in the personal store and the the certificate that issued it must be place into the Trusted Root Certification Authorities (if it is the last one in the chain).

Here is an example ( i ran certlm.msc and clicked the end entity certificate:

enter image description here

  • Sectico is the root certificate and goes to Trusted Root Certification Authorities
  • COMODO RSA ... is the intermediate certificate and goes to Intermediate Certification Authorities
  • Daniel... is the end entity certificate and goes to Personal

I recommend to import into Personal and then move (drag-drop) the certificates.

For the end entity there must be a private key associated - which can be identified by the key icon:

enter image description here

Microsoft also provides some documentation on the topic: https://learn.microsoft.com/en-us/previous-versions/msp-n-p/ff648360(v=pandp.10)?redirectedfrom=MSDN

Upvotes: 0

Related Questions