EDIT: the actual solution
Netty expects a final \n
character to be appended to the string.
Using Write()
does not append that final character, thus the string never flushes on the server.
Pay attention: Environment.NewLine
is platform dependent and may append \r\n
if the message is sent from Windows clients. Netty, instead, honors a communication protocol which requires a Linux compliant newline. To comply to Netty's protocol append a literal \n
manually to the string before serializing it!
Are you sure you correctly validate the server?
new RemoteCertificateValidationCallback(ValidateServerCertificate)
Try to remove this line. You will have the client to connect even on non-certified servers, but the rest should remain intact.
If the server now receives the message correctly, then it is the client that cannot validate the server correctly.
This may depend on many defects. Often it is the CA or the certificate. You can attach a custom validation handler if the server fails to be certificated. Use that and see what error you get.
Pointer: validation callback
BTW: are you sure you have to certify the server? You can have encryption without certifying the client or server. Those are all different security features of SSL and not always do you need all of them.