Skip to content

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
@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