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

RuntimeException when Graylog SSL expired #32

Closed
florianbrinkmann opened this issue Sep 15, 2021 · 5 comments
Closed

RuntimeException when Graylog SSL expired #32

florianbrinkmann opened this issue Sep 15, 2021 · 5 comments

Comments

@florianbrinkmann
Copy link

Hi,

first, thanks for the package!

I ran into an issue while using it and connecting to a Graylog instance via HTTPS. The Graylog SSL expired and I got the following error:

Failed to create socket-client for ssl://graylog.example.com:6000: (0) {"userId":1,"exception":"[object] (RuntimeException(code: 0): Failed to create socket-client for ssl://graylog.example.com:6000: (0) at /path/to/laravel/vendor/graylog2/gelf-php/src/Gelf/Transport/StreamSocketClient.php:157)

Is that something that can be fixed in your package, or does the Exception need to be handled in graylog2/gelf-php?

Thanks!

@hedii
Copy link
Owner

hedii commented Sep 15, 2021

Hi, why not simply fix the certificate?

There is an SslOptions class for the TcpTransport in graylog2/gelf-php, but we are not using it.

The SslOptions class has a method to enable or disable the peer certificate check.

If you cannot renew the graylog host certificate, maybe you should use graylog2/gelf-php directly with the ssl options instead of using hedii/laravel-gelf-logger.

Or submit a tested PR here to add this new functionality for the tcp transport.

@florianbrinkmann
Copy link
Author

Hi, yes, the certificate was renewed now, but I thought it would be nice if no exception would be thrown if the certificate is invalid for some reason. I will see if I can provide a PR.

@hedii
Copy link
Owner

hedii commented Jan 10, 2022

I am closing but feel free to submit your PR regarding the certificate validation.

@hedii hedii closed this as completed Jan 10, 2022
@hedii
Copy link
Owner

hedii commented Jan 16, 2022

@florianbrinkmann check release 6.2.0

You can now use ssl on tcp and http transports, with an option to enable or disable certificate validation on peer.

@florianbrinkmann
Copy link
Author

Thanks a lot @hedii! And sorry I did not follow up with a PR myself, the cert renewal was working now so the issue did not appear again and I forgot it…

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

No branches or pull requests

2 participants