Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better error message #567

Open
wants to merge 1 commit into
base: 4.0.x
Choose a base branch
from

Conversation

jasverix
Copy link

Target branch: 4.x

  • It is a Bug fix
  • It is a New feature
  • It is related to dependencies

Includes:

  • Breaks BC
  • Deprecations

The error message if a key fails is not very informational. The openssl extension provides more details, so we need that in the exception thrown.

@Spomky
Copy link
Member

Spomky commented May 27, 2024

Hi,

Many thanks for this PR. Howvever it may send truncated messages or false.
An alternative could be as follows:

$opensslMessages = [];
while ($m = openssl_error_string()) {
    $opensslmessages[] = $m;
}
throw new InvalidArgumentException('Unable to load the key.', ['opensslMessages' => $opensslMessages]);

EDIT: to be rebased for 3.4.x

@Spomky Spomky self-assigned this May 27, 2024
@Spomky Spomky added this to the 3.4.4 milestone May 27, 2024
@Spomky Spomky changed the base branch from 4.0.x to 3.4.x May 27, 2024 05:13
@Spomky Spomky changed the base branch from 3.4.x to 4.0.x May 27, 2024 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants