>
 Wednesday, July 01, 2009
« Giving WPF Some Love | Main | Exception Handling Proxy - eating your o... »

I have never run into this problem before, but I just realized that in WCF applications when I provide a certificate reference with FindBySubjectName - it can fail if you have two similarly named (not identical) certificates. I don't think this is by design, it has to be a bug, but I found a workaround.

Short and Sweet...here it is. If I have a certificate reference like this for "RP":

<certificateReference findValue="RP" storeLocation="LocalMachine" 
storeName="My" x509FindType="FindBySubjectName"/>

But, I also have a cert named "RPSTS" in the same cert store, the lookup fails because it can't find a unique cert by the name RP. I don't know about you but I think "RP" and "RPSTS" are pretty unique...but not as far as WCF is concerned. I usually use FIndByThumbprint for production code, but for code samples and reference materials I want it to be obvious which cert we are dealing with, it is hard enough to trouble-shoot certs without having to look up thumbprints every time.

A workaround for this is to use FindBySubjectDistinguishedName so this works even if I have "CN=RP" and "CN=RPSTS" in my cert store.

<certificateReference findValue="CN=RP" storeLocation="LocalMachine" 
storeName="My" x509FindType="FindBySubjectDistinguishedName"/>

Shweet!

Technorati Tags: ,
7/1/2009 10:15 PM WCF  | Comments [1]  |  View reactions  |  Trackback
Friday, August 07, 2009 10:36:17 PM (GMT Daylight Time, UTC+01:00)
Thanks for the info. I was not using 'CN=' in front of my certificate common name.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (HTML not allowed)  

    ON THIS PAGE
    SEARCH
    CATEGORIES
    ARCHIVES
    BLOGROLL

Designed by NUKEATION STUDIOS