A more descriptive message for SSL error when agent-auth fails#2941
Merged
chemamartinez merged 1 commit into3.9from Mar 29, 2019
Merged
A more descriptive message for SSL error when agent-auth fails#2941chemamartinez merged 1 commit into3.9from
chemamartinez merged 1 commit into3.9from
Conversation
Contributor
Author
TestingSetting up the manager's
Registering an agent on the new Registering on the standard The port is indeed not open in this configuration. Registering on the new Registration OK. ControlRegistering the agent on a manager with the standard configuration (default ports, no password, Registration OK. Protocol for Registration fails and this is OK. Specifying port 1515 (default for Registration OK. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, Team,
This PR should fix the issue #2905.
Problem description
When
remotedis configured to use protocoltcpin the manager'sossec.conf:registering the agent on the
remotedport (by accident, by error, for testing purposes) returns a very generic message:Problem explanation
The code in
src/os_auth/main-client.cin v3.9 reads:OS_ConnectTCP()(line 334) returns a valid socket because the port is open.SSL_Connect()(line 346) returns-1becauseremotedcan't handle the message. On the manager,ossec.loggets a warning message such as this one:Solution
As decribed in a comment in the issue (#2905 (comment)), there is no easy way to get a descriptive message by just using the error functions provided by SSL.
So the easiest solution is to change the error message to something like:
Testing
See below.