Skip to content
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

Connect with TLS #23

Closed
awenger opened this issue Dec 6, 2015 · 4 comments
Closed

Connect with TLS #23

awenger opened this issue Dec 6, 2015 · 4 comments

Comments

@awenger
Copy link

awenger commented Dec 6, 2015

I'm trying to connect to the GCM XMPP Connection Server [1] with Hedwig. They require a TLS connection and don't support STARTTLS [2]. I tried different combinations in the config but it won't connect.

[info]  Outgoing stanza: {:xmlstreamstart, "stream:stream", [{"to", "gcm.googleapis.com"}, {"version", "1.0"}, {"xml:lang", "en"}, {"xmlns", "jabber:client"}, {"xmlns:stream", "http://etherx.jabber.org/streams"}]}
[error] GenServer #PID<0.165.0> terminating
** (MatchError) no match of right hand side value: {:error, {'not well-formed (invalid token)', <<21, 3, 1, 0, 2, 2, 70>>}}
    (hedwig) lib/hedwig/transports/tcp.ex:158: Hedwig.Transports.TCP.handle_data/3
    (stdlib) gen_server.erl:615: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:681: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:tcp, #Port<0.5575>, <<21, 3, 1, 0, 2, 2, 70>>}
State: %Hedwig.Transports.TCP{client: #PID<0.162.0>, compress?: false, config: %{client: #PID<0.162.0>, ignore_from_self?: true, port: 5235, preferred_auth_mechanisms: ["PLAIN"], require_tls?: true, server: "gcm-xmpp.googleapis.com", transport: Hedwig.Transports.TCP, use_compression?: false, use_stream_management?: true}, parser: {:parser, "", []}, pid: #PID<0.164.0>, socket: #Port<0.5575>, ssl?: false, transport: Hedwig.Transports.TCP}

However, if I replace :gen_tcp with :ssl in the Hedwig.Transports.TCP module the connection is established without errors. Is there some settings to force such behavior in the config?

[1] https://developers.google.com/cloud-messaging/xmpp-server-ref
[2] https://developers.google.com/cloud-messaging/ccs

@scrogson
Copy link
Member

scrogson commented Dec 6, 2015

@awenger thanks for the report. At this time, this is not configurable, but it certainly should be. I'm currently in the middle of rewriting Hedwig so I won't be able to address this right now.

@awenger
Copy link
Author

awenger commented Dec 6, 2015

Happy to hear that this will be supported in a future version. Thanks for the lib. For the time being manually replacing :gen_tcp with :ssl is a manageable workaround for me.

@scrogson
Copy link
Member

scrogson commented Dec 7, 2015

Excellent. I am currently working to make Hedwig more generic (adapter
based). The first adapter will be XMPP of course :)

I would love some feedback once it's ready.
On Sun, Dec 6, 2015 at 20:47 awenger notifications@github.com wrote:

Happy to hear that this will be supported in a future version. Thanks for
the lib. For the time being manually replacing :gen_tcp with :ssl is a
manageable workaround for me.


Reply to this email directly or view it on GitHub
#23 (comment).

@scrogson
Copy link
Member

@awenger thanks again for the report! I've created an issue on scrogson/romeo#2 to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants