Yeah there's ERR_get_error() which returns an unsigned long that can be fed to ERR_reason_error_string so hopefully that can get us where we need to be.