Using simple XOR encryption, the server reports this error "Received invalid packet type/version from client - possibly due to client using wrong password or crypto algorithm?".
This is due to the encryption_method variable in NagiosAppender class: i.e. if I use the configuration file to sets the encryption_method parameter, when the send_nsca(String, int) method have been invoked, it use the global encryption_method variable, but nobody's sets it.
To resolve it,
- adds the getEncryption_method getter in Nsca class
- in setConfigFile(String) method, after nagiosClient.setConfigFile(value), adds encryption_method = nagiosClient.getEncryption_method()
I attach a zip file with the java source modified surround by mbm099 comments
Source file mdified
There is a simpler workaround for the bug: Ditch the ConfigFile parameter from the appender and add this line:
<param name="EncryptionMethod" value="1" />