81a6b9a Return the <Message> value cert-find failures from the CA

Authored and Committed by rcritten 2 years ago
    Return the <Message> value cert-find failures from the CA
    
    If a cert-find fails on the CA side we get a Message tag
    containing a string describing the failure plus the java stack
    trace. Pull out the first part of the message as defined by the
    first colon and include that in the error message returned to
    the user.
    
    The new message will appear as:
    
    $ ipa cert-find
    ipa: ERROR: Certificate operation cannot be completed: Unable to search for certificates (500)
    
    vs the old generic message:
    
    ipa: ERROR: Certificate operation cannot be completed: Unable to communicate with CMS (500)
    
    This can be reproduced by setting nssizelimit to 100 on the
    pkidbuser. The internal PKI search returns err=4 but the CA
    tries to convert all values into certificates and it fails. The
    value needs to be high enough that the CA can start but low
    enough that you don't have to create hundreds of certificates
    to demonstrate the issue.
    
    https://pagure.io/freeipa/issue/9369
    
    Signed-off-by: Rob Crittenden <rcritten@redhat.com>
    Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
    
        
file modified
+15 -1