domingo, 26 de febrero de 2012

Como otorgar permisos a un certificado

 

[Español]

Hola a todos, alguna vez les ha pasado que tienen estas probando una aplicaión que utiliza certificados para autenticar applicaciones, todos les funciona bien hasta cuando prueban el codigo y el certificado instalado en el server, corren la aplicación y bam justo ahi reciben el siguiente error:

“Error: ID1039: The certificate's private key could not be accessed“

Ven  esto, revisan todo, y todo parece bien, pero no importa lo que hagan siguen recibiendo el mismo mensaje. 

Para arreglar esto simplemente sigue estos pasos sencillos que solucionaran el problema:

1. Descarga la siguiente herramienta de este link : winhttpcertcfg.

2.Instala esta herramienta. (Toma nota donde se instalo porque vas a necesitar eso para el siguiente paso).

3. Abre una consola (ojo ejecutala como Adminstrador para que no te de error). Ejecuta el archivo winhhtpcercfg.exe desde su carpeta de instalación con tal como se muestra a continuación.

C:\Program Files (x86)\Windows Resource Kits\Tools>winhttpcertcfg.exe -g –c [UbicaciónDelCertificado] –s [NombreDelCertificado] –a [Usuario]

[UbicaciónDelCertificado] no es el directorio en el disco duro donde tienes el archivo esto es algo como LOCAL_MACHINE\My

[NombreDelCertificado] es tal como aparece el certificado en MMC/Certificates

[Usuario] puede ser algo como NetworkService

Luego de correr esto, prueba aplicación y esto lo debe resolver. 

 

Espero les ayude.

 

Saludos

Julio Valencia

 

[English]

 

Hello everyone, have you ever been in a situation where you are testing application that uses certificates to authenticate users; everything works perfect in the development machine, but as soon you move your application to the test server, bam!! you get this error message:

“Error: ID1039: The certificate's private key could not be accessed“

You see this message, you check everything but everything looks fine, you just can’t figure out what is happening.  In order to fix this you just need to follow these steps and you will good to go:

1. Download the following tool from this link: winhttpcertcfg.

2. Install this tool (Please make sure you write the installation folder down because you will need it in the next step).

3. Open a command windows (Please do it as Administrator or you might have some issues). Run it as follows:

C:\Program Files (x86)\Windows Resource Kits\Tools>winhttpcertcfg.exe -g –c [CertificatePath] –s [CertificateName] –a [User]

[CertificatePath] is not the Hard Drive folder, this is where your certificate was imported such as LOCAL_MACHINE\My.

[CertificateName] is the name of the certificate as you see it using MMC.

[User] is the user that you want to grant access to, for example: NetworkService.

After you run this you should good to go.

I hope this help.

Regards,

Julio Valencia

No hay comentarios:

Publicar un comentario

Nota: solo los miembros de este blog pueden publicar comentarios.