Custom ports & Android

I can not seem to get the android app to connect to a mattermost at a custom port (but desktop, browser, and iOS work fine).

Is this a bug with the android app or a restriction?

Hi @tyler,
the app supports custom ports in the form of https://domain.tld:12345.
If it’s not connecting then the issue might be at a different point during the connection.

One thing that’s often comes up are certificate issues, just in case you have TLS already setup on your server it might be worth looking into.

I verified that the android device in question connects fine with the same address in a browser.

I do have TLS setup using LetsEncrypt, is there a way to verify or test that it is working? I’ve checked in a browser that the lock icon is there with the correct certificate info.

Hello, @Tyler

If your Mattermost instance is public facing, can you run a hostname test on https://www.ssllabs.com/ssltest/ and share your findings? Also, what is the error that you are seeing on your Android app when you tried to access it?

Unfortunately my instance is public facing, but on a port other than 443.

The error on the android app is “Cannot connect to the server. Please check your server URL and internet connection.”. I’ve tried both when connected locally to the server over WiFi and when over mobile data, in both cases I get the same error but copy/pasting the link into a browser works fine.

Hello, @Tyler

Thanks for the confirmation. I am checking this with the mobile team to see if it is a specific issue with the mobile app not playing nice with non standard HTTPS port and if there is any configuration changes that needs to be done on the device to make it work. Stay tuned.

Any updates on this?

Hello, @Tyler

Sorry for the delayed response. Been busy on my end.

I got the confirmation that there should not be any issues running Mattermost on custom ports as long as the SSL certificate is valid (CA signed) and does not have any problems with the chain. Can you please confirm the details of the SSL certificate that is implemented for this instance?

The SSL certificate is from Let’s Encrypt, could it be that it’s a wildcard certificate?

As far as can tell from chrome and browsers (including on the same device that doesn’t connect in the app), there doesn’t appear to be any chain issues.

Hi, @Tyler

While I don’t think it’s an issue with the wildcard certificate, I’d like to highlight the following based on the Configuring TLS on Mattermost Server:

Your Mattermost server must be accessible from the Let’s Encrypt CA in order to verify your domain name and issue the certificate. Be sure to open your firewall and configure any reverse proxies to forward traffic to ports 80 and 443. More information can be found at Let’s Encrypt.

Since your instance is public facing, can you send me a DM of the FQDN and the port you are using?

I don’t have an option to DM you through this discourse forum.

Hi, @Tyler

I have responded you with my finding through the direct message. Please confirm so we can update this public topic accordingly. Thanks.