The error message you're encountering suggests that there's a mismatch in the SSL/TLS communication between your local web UI application and the n8n service. Specifically, the message:
[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1006)
indicates that the client is attempting to establish an HTTPS connection, but the server (n8n) is either not configured for HTTPS or is expecting a different TLS version.
Here's a step-by-step guide to help you diagnose and resolve this issue:
1. Check the Connection Protocol (HTTP vs. HTTPS)
Issue:
It's possible that your web UI is trying to establish an HTTPS connection to the n8n service, which might be running with plain HTTP.
Solution:
-
Use HTTP Instead of HTTPS: If n8n is configured to use HTTP on port 5678, ensure that your web UI is also using http:// rather than https:// when connecting.
Example:
// Instead of using https
const url = 'https://n8n:5678/webhook/invoke_n8n_agent';
// Use http
const url = 'http://n8n:5678/webhook/invoke_n8n_agent';
-
Update Configuration Files: Check your web UI application's configuration files or environment variables to ensure the correct protocol is specified.
2. Verify n8n's SSL Configuration
Issue:
If you intend to use HTTPS, n8n might not be properly configured with the necessary SSL certificates.
Solution:
-
Check n8n Configuration:
- Ensure that n8n is set up with valid SSL certificates.
- Verify the paths to the SSL certificate and key in the n8n configuration.
-
Enable HTTPS in n8n:
If not already enabled, configure n8n to serve over HTTPS. This typically involves setting environment variables or configuration options related to SSL.
Example Environment Variables:
N8N_PROTOCOL=https
N8N_SSL_CERT=/path/to/cert.pem
N8N_SSL_KEY=/path/to/key.pem
3. Inspect Docker or Network Configurations (If Applicable)
Issue:
If you're using Docker or another containerization platform, network configurations might prevent proper SSL handshake.
Solution:
-
Docker Networking:
- Ensure that the
n8n hostname correctly resolves within your Docker network.
- Verify that ports are properly exposed and mapped.
-
Proxy Settings:
- If there's a reverse proxy (like Nginx or Traefik) in front of n8n, ensure it's correctly handling SSL termination.
4. Test the Connection Manually
Issue:
Manually testing the connection can help isolate whether the issue is with the client's configuration or the server's setup.
Solution:
-
Using curl:
-
Analyze the Response:
- A successful response means the endpoint is reachable.
- Errors will provide more insight into where the connection is failing.
5. Review Logs for Detailed Errors
Issue:
Logs can offer more granular details about why the SSL handshake is failing.
Solution:
-
n8n Logs:
- Check the logs of the n8n service for any SSL-related errors or warnings.
-
Web UI Logs:
- Inspect your web application's logs to see if there are additional error messages or stack traces.
6. Update SSL/TLS Libraries
Issue:
Outdated SSL/TLS libraries can lead to compatibility issues.
Solution:
7. Environment Variable and Host Resolution Checks
Issue:
Misconfigured environment variables or incorrect host resolution can lead to connection issues.
Solution:
8. Consult n8n and Web UI Documentation
Issue:
There might be specific configurations or known issues related to connecting your particular web UI to n8n.
Solution:
-
n8n Documentation:
- Review the n8n documentation for any guidelines on setting up webhooks and ensuring secure connections.
-
Web UI Documentation:
- Check your web UI application's documentation for any specific instructions or prerequisites when integrating with n8n.
Summary of Recommended Steps
-
Switch to HTTP if n8n Doesn't Use HTTPS:
- Modify your web UI to use
http://n8n:5678/webhook/invoke_n8n_agent instead of https://n8n:5678/webhook/invoke_n8n_agent.
-
Configure SSL Properly if HTTPS is Needed:
- Ensure that n8n is set up with valid SSL certificates and is configured to handle HTTPS requests on port
5678.
-
Verify Network Configurations:
- Check Docker or other networking setups to ensure proper hostname resolution and port mapping.
-
Test Connections Manually:
- Use tools like
curl to verify if the n8n endpoint is reachable and responds correctly.
-
Review and Update Libraries:
- Ensure all related software and libraries are up to date to support necessary SSL/TLS versions.
By following these steps, you should be able to identify and resolve the SSL-related connection issue between your local web UI application and the n8n service.
If you continue to face issues after trying the above solutions, please provide additional details about your setup, such as:
- Are you using Docker or running services directly on your host?
- How is n8n configured (especially regarding SSL)?
- Any relevant snippets from your web UI application's configuration files.
This information will help in providing more tailored assistance.