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

TLS initialization #23

Open
eadrwlo opened this issue Sep 10, 2018 · 3 comments
Open

TLS initialization #23

eadrwlo opened this issue Sep 10, 2018 · 3 comments

Comments

@eadrwlo
Copy link

eadrwlo commented Sep 10, 2018

Hi. Do you know how handshake a secure connection?
I get this error when I tried do set config.setSecurityMode(SecurityMode.required);
Exception in thread "main" org.jivesoftware.smack.SmackException$SecurityRequiredByClientException: SSL/TLS required by client but not supported by server

I know that Firebase do not support STARTTLS extension. So how to do it in the other way?

@carlosCharz
Copy link
Owner

Hi @eadrwlo I had the same pending task. I found out the same thing that firebase do not support STARTTLS extension. I currently have: config.setSecurityMode(SecurityMode.ifpossible);

I am sorry I cannot help you with that because I am still looking for the solution.

@eadrwlo
Copy link
Author

eadrwlo commented Sep 11, 2018

So, Do you know, how it is possible our connection are not refused if we do not meet the below criteria(from FCM docs)??

The connection has two important requirements:

  • You must initiate a Transport Layer Security (TLS) connection. Note that FCM doesn't currently support the STARTTLS extension.

@eadrwlo
Copy link
Author

eadrwlo commented Sep 11, 2018

I just noticed that if I connect to port 5235 (Production) packet goes over TLS. In other case If I use port 5236 (testing) packet are seen in TCP format. I have monitored it in the Wireshark. Moreover paramater SecurityMode.disabled or SecurityMode.ifpossible do not have any impact on this. Only if this param is set to SecurityMode.required I get this Exception (described in first post) and then probably server try to perform this STARTTLS procedure which is not supported. I suppose config.setSocketFactory(SSLSocketFactory.getDefault()); with the secure port 5235 do the job and handshake TLS is performed after XMPP initial stanzas exchange.

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