Home > ASP.NET > Client Certificate from the User Store to the Local Machine Store

Client Certificate from the User Store to the Local Machine Store

If a service application such as ASP.NET Web application cannot access a client certificate that other applications like console applications can access, then the client certificate may not be stored in the local machine. You can understand that something like that may be happening if you get the error:

Could not create SSL/TLS secure channel for your Web Request and you can’t understand what is going wrong while it might be ok at your development machine but when you try to publish it you get this error.

So let’s copy a client certificate in the local user store to the local machine store by using the Certificate Export Wizard following the steps below:

  1. Click Start, click Run, type mmc, and then click OK.
  2. On the File menu, click Add/Remove Snap-in, and then click Add.
  3. In the Add Standalone Snap-ins dialog box, click Certificates, click Add, click Computer account, click Next, and then click Finish.
    image
  4. In the Add Standalone Snap-ins dialog box, click Certificates, click Add, click My user account, and then click Finish.
    image image
  5. Click Close, and then click OK.
    image
  6. To export the client certificate from the local user store, follow these steps:
    1. Expand Certificates – Current User, expand Personal, and then click Certificates.
      image
    2. Right-click the client certificate, click All Tasks, click Export, and then click Next.
      image
    3. Click Yes, export the private key, and then click Next two times.
      image image
    4. In the Password box and in the Confirm Password box, type a password, and then click Next.
      image
    5. In the File name box, type a file name. Click Next, and then click Finish.
      image
    6. In the Certificate Export Wizard dialog box, click OK.
      image
  7. To import the client certificate to the local machine store, follow these steps:
    1. Expand Certificates (Local Computer), and then expand Personal.
      image
    2. Right-click Certificates, click All Task, click Import, and then click Next.
      image
    3. In the File name box, type the file name that you specified in step 6e, and then click Next.
      image
    4. In the Password box, type the password that you specified in step 6d, and then click Next two times.
      image image
    5. Click Finish, and then click OK.
      image
Categories: ASP.NET Tags: ,