Tuesday, August 11, 2009

WSE & X.509 certificate related issues

Well, this one was rather time consuming to figure out and still getting things worked out as I write this. The seemingly straight forward but not so thing was dealing with certificates. Here is a little back ground. I got the certs from the client and supposedly seamlessly install and be up. Well not so, as with others as I found from googling.

Lesson 1 - don't install certificate by double clicking as you rather want it to be installed under Local Machine as opposed to Current User. People wrote about this all over the place.

Ok, then got the error "WSE2013: X509TokenProvider is unable to provide an X.509 token. There are no certificates in the certificate store that match the find value of...". Well searching for it resulted in many interesting and similar encounters by others. Particularly I liked Meteorist's Blog.

Again, tried all the suggestions, including using the full subject (copied from the cert) instead of just certificate name ("CN=xxxx"). Turns out to be that my solution is to CreateToken using Serial Number. The default create token uses find by name but changed it to something like:


X509SecurityToken clientX509Token = X509TokenProvider.CreateToken(
StoreLocation.LocalMachine,
StoreName.TrustedPeople,
"1234567890",
X509FindType.FindBySerialNumber);

And that got me through that part and encountered next level of problems. Will update when I find any more interesting points to blog about this experience.

Love coding!

No comments: