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

Base64 encode serialized publicKeyDetail #190

Merged
merged 2 commits into from
Jun 28, 2024
Merged

Base64 encode serialized publicKeyDetail #190

merged 2 commits into from
Jun 28, 2024

Conversation

jszobody
Copy link
Contributor

@jszobody jszobody commented Jun 27, 2024

I'm running into issues where the SslCertificate instance can't be serialized for a queue job, due to binary "malformed UTF-8" characters is some of the publicKeyDetail.

I'm specifically running into this in the laravel-uptime-monitor package, when a certificate is included in a queued CertificateCheckSucceeded event. See here:

spatie/laravel-uptime-monitor#359

This PR base64 encodes the publicKeyDetail part of the certificate when serializing, and handles decoding on unserialize.

I have this fork installed in my own app, and have verified it resolves the issue.

Test case added to verify serialize/unserialize works properly, and that we can json_encode a serialized certificate.

@jszobody jszobody marked this pull request as ready for review June 27, 2024 22:21
@freekmurze freekmurze merged commit d997f89 into spatie:main Jun 28, 2024
12 checks passed
@freekmurze
Copy link
Member

Thank you!

@jszobody jszobody deleted the serialization branch June 28, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants