Cannot login into Android Rocket.Chat App

Hi There

I’ve installed rocket.chat on Ubuntu 18.04.3 LTS. For SSL I’ve installed NGNIX as a Reverse Proxy with the following Config:

Upstreams

upstream backend {
server 127.0.0.1:3000;
}

#HTTP to HTTPS Redirect
server {
listen 80;
listen [::]:80;
server_name mydoamin.com;
return 301 https://mydoamin.com$request_uri;
}

HTTPS Server

server {
listen 443;
server_name mydoamin.com;

# You can increase the limit if your need to.
client_max_body_size 200M;

error_log /var/log/nginx/rocketchat.access.log;

ssl on;
ssl_certificate /etc/nginx/certificate.crt;
ssl_certificate_key /etc/nginx/certificate.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don’t use SSLv3 ref: POODLE

location / {
    proxy_pass http://backend/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;

    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forward-Proto http;
    proxy_set_header X-Nginx-Proxy true;

    proxy_redirect off;
}

}

So everything works fine on the browser with rocket.chat and SSL as well. The Problem ist I cannot login to rocket.chat via the android app. It keep saying the URL is wrong eventhough I can open rocket.chat via the smartphone’s browser. On IPhone I’m able to login to Rocket.Chat via the App.

Does anyone know what the problem is?

Thanks for your help!

Hello @epsup
i have the same problem as well , my Reverse Proxy is Microsoft IIS with Application Request Routing .
there is no problem with Browser and Certificate , just on Android app when i supply credential nothing happened … i try to test with iPhone as soon.

on iPhone same issue

curl “https://chat.XYZ.com/api/info
{“version”:“2.3.2”,“success”:true}

I’ve managed to fix it.

The problem was NGNIX as the Reverse Proxy. It has for some reason problems with websockets.
I uninstalled NGNIX and installed Apache as my reverse proxy and followed the instructions here:
https://rocket.chat/docs/installation/manual-installation/configuring-ssl-reverse-proxy/

And after that everything worked fine.

I hope this helps someone else that run into this problem.

1 Like

Hi

I have same problem too. my revers proxy server is Apache and I have been configured it with best practice that was wrote in RocketChat Docs. when I use my URL that same as https://chat.company.com I see “Invalid URL or unable to establish a secure connection…” on Android Mobile App but this URL work on browsers and Windows App correctly! If I use http://chat.company.com:3000,my Mobile Android App connect to server correctly.
I couldn’t understand whats that.
Thanks,

I´ve got the same issue than you. I got to solve it adding the intermediate certificate in the /etc/nginx/certificate.crt file (refering the nginx session in the official how to https://rocket.chat/docs/installation/manual-installation/configuring-ssl-reverse-proxy/ )
Copy and paste it after the certificate data of the certificate file.
The apache approach works because it adds the intermediate certificate in the procedure.

1 Like

Thank You!! works like a charm!:slight_smile: