-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect non-TLS: unable to verify the first certificate
#42
Comments
unable to verify the first certificate
Thanks @silverbucket for reporting this. I apologise for replying with a huge delay, but honestly we are rarely checking the issues for this repo, because it is only a helper repository for MongooseIM. Regarding the issue, MongooseIM actually has TLS enabled in the default configuration file, because the [[listen.c2s]]
port = 5222
access = "c2s"
shaper = "c2s_shaper"
max_stanza_size = 65536
#tls.verify_mode = "none"
#tls.certfile = "priv/ssl/fake_server.pem" When I tested this with your JS script, I figured out that somehow the connection was dropped. This led me to discover a bug, which I fixed in esl/MongooseIM#4150. |
When the TLS section is missing, then according to the documentation STARTTLS should be rejected. This was not the case: the feature was advertised, and a TLS upgrade performed by a client (who was informed about the support) resulted in a crash. This PR fixes these issues: STARTTLS is only advertised when enabled. Upgrade attempt results in a correct failure element, as described in RFC 6120 The tests are updated to check these conditions, and to correctly verify the features for optional and required STARTTLS as well. The bugs were discovered accidentally when checking esl/mongooseim-docker#42. The statement about TLS disabled by default is changed in the docs, because it most likely confused the reporter of that issue.
Related bugs are fixed now, and the docs are updated. |
@chrzaszcz thanks for following up on this! I'm glad it led to a bug being fixed, even if indirectly :) Also I had a look at the updated docs and it does read more clearly now. Cheers! |
I am running the
mongooseim
docker image locally, have created a test account, but am unable to connect due to a TLS error. From what I've readmongooseim
should be defaulting to non-TLS unless provided with certs (which I have not done). Similarly,xmpp.js
will default to non-TLS as well.I've broken it down to as simple an example as I could. Any help would be greatly appreciated, I feel like I may be overlooking something quite simple.
start service and create user
$ docker run -d -t -h mongooseim-1 --name mongooseim-1 -p 5222:5222 mongooseim/mongooseim:4.2.0 $ docker exec mongooseim-1 /usr/lib/mongooseim/bin/mongooseimctl register_identified jimmy localhost passw0rd
connect
Using
xmpp.js
node library, here's a simplified script (test-client.js
) which illustrates the problem:The text was updated successfully, but these errors were encountered: