The current implementation of nss_passwdaliases is very simple. It does a simple string compare of what it's given and what's in the config file. Unfortunately this is not the correct method to compare DNs. Some parts of complex DNs can vary in order, whilst still referring to the same thing. Scenarios when this might happen is if we tweak the implementation in the client, or another implementation is used. The order might also shift if a new certificate is issued with the same subject. Ideally we'd do the comparison properly, ignoring order when appropriate. A temporary solution could be to strictly specify the order, e.g. sort by OID.