Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cleartext communication not permitted

Hey,

 

while working on an app, I came across this error:

Companion: WebSocket connection to 'ws://[hostname]:4444/' failed: Error in connection establishment: net::ERR_CLEARTEXT_NOT_PERMITTED

 

Searching through the internet, I quickly found this thread: https://community.fitbit.com/t5/SDK-Development/HTTP-is-not-supported-in-FitBit-app-starting-with-An...

Which quickly explains the error.

 

The connection I am trying to make is local-only with no sensible data, so that it is cleartext is no issue.

As the reply in the other thread states, some IPs have been allowed, which is why 127.0.0.1 aswell as local IPv4 addresses in the format of 192.168.x.x work.

However, for my use case I would highly prefer to either use IPv6 or even better local hostnames.

 

Is there any chances to get these whitelisted? If not hostnames, as I understand it can be a lot of work to detect whether these are local, then if at least local IPv6 addresses could be allowed that'd be great.

 

Thank your for your help

Best Answer
1 REPLY 1

It's actually a security implementation at the mobile OS level. If you want to use other hosts, they need to be SSL secured. I don't believe it works locally for self-signed certs though.

Best Answer