Hello Wazuh Community,
I have an issue when registering a Wazuh agent from AWS to my Wazuh Manager On Premise using agent-auth.
Environment
Command:
Error
Agent registration fails with:
Checks performed
Testing with:
returns:
The TCP connection is established, but the TLS handshake is closed immediately.
Question
What could cause wazuh-authd to close the TLS connection immediately during agent enrollment?
Are there any specific Wazuh 4.14.5 configurations required when exposing port 1515 through NAT/reverse forwarding?
Is there any known issue related to Docker deployment and agent-auth SSL handshake?
Thank you.
Hi Gabriel,
Firstly, have you followed the Docker installation guide? If not, please check the documentation to ensure everything is set up correctly:
The key piece of information in your report is the openssl s_client output:
SSL handshake has read 0 bytes and written 323 bytes no peer certificate available unexpected eof while readingThose 323 bytes written are the ClientHello. 0 bytes read means nothing ever answered with a ServerHello — the TCP connection was accepted by something, and that something closed it before sending a single TLS byte. SSL error (5) is SSL_ERROR_SYSCALL, which is consistent with that.
This tells us the failure happens before the TLS handshake, which rules out everything you already checked:
So the certificates, the password and the <auth> block are almost certainly not the problem.
Why your reachability test is inconclusiveWith the default Docker userland proxy, docker-proxy binds the published port on the host and accepts the TCP connection before connecting to the container. If the backend is not reachable, it closes the accepted connection. That produces exactly what you are seeing: connection established, 0 bytes, EOF.
The same applies to your NAT/reverse forwarding: port 1515 is raw TLS, not HTTP. An nginx server {} block, an ALB, or any L7 proxy will accept the connection and close it as soon as it sees non-HTTP bytes. Per the load balancer documentation, 1515 must be plain TCP passthrough — stream in nginx, mode tcp in HAProxy — with no TLS termination.
Troubleshooting steps1. Separate the network path from wazuh-authd. Run this from inside the manager container:
docker exec -it wazuh-manager openssl s_client -connect 127.0.0.1:15152. Confirm what is actually listening inside the container:
docker exec wazuh-manager ss -lntp | grep 1515 # expect 0.0.0.0:1515, wazuh-authd docker exec wazuh-manager /var/ossec/bin/wazuh-control status3. Check the manager log:
docker exec wazuh-manager grep -iE "authd|SSL" /var/ossec/logs/ossec.log | tail -504. Enable verbose authd debugging (see internal options):
echo "authd.debug=2" >> /var/ossec/etc/local_internal_options.conf # restart the manager, then retry the enrollmentThen retry and watch ossec.log. This is the step that settles it:
Once step 1 or step 4 tells you which side is closing the connection, the fix is usually straightforward. Let us know what you find.