For the case of SIGNERNOTCA, INSECUREALG, or a newer unhandled value,
the "(a)ccept always" prompt was allowed, but the cert saving was
prevented by a check only against NOTTRUSTED. This ended up giving a
strange error message saying the cert was not saved.
Fix to save the cert for all errors except HOSTNAME (which is handled
separately).
fprintf(fp, "#H %s %s\n", hostname, fpbuf);
done = 1;
}
- if (certerr & CERTERR_NOTTRUSTED)
+ /* Save the cert for all other errors */
+ if (certerr ^ CERTERR_HOSTNAME)
{
done = 0;
ret = gnutls_pem_base64_encode_alloc("CERTIFICATE", certdata, &pemdata);