Skip to content

Let's encrypt CA websocket fails on Android api < 20  #18032

@perrosnk

Description

@perrosnk

Is this a bug report?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 9.3.0
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 2.1 AI-143.2915827

Packages: (wanted => installed)
react: 16.0.0-beta.5 => 16.0.0-beta.5
react-native: 0.49.3 => 0.49.3
Target Platform: iOS (10.3)

Steps to Reproduce

I have a node server which uses Let's Encrypt CA. I try to connect to it using websockets.
On iOS and newer Android versions (API > 20) it connects successfully.
When running on older Android versions (both on simulator and actual devices) it never connects.
I have tried to connect using older Android version to a server that's not using Let's encrypt CA, and it also connects successfully.

The error I get when using this:

    ws.onerror = (e) => {
      // an error occurred
      console.log(e.message);
    };

is Connection closed by peer

and this:

    ws.onclose = (e) => {
      // connection closed
      console.log(e.code, e.reason);
    };

logs undefined, undefined

Expected Behavior

Connect to the server

Actual Behavior

Fails

Reproducible Demo

    var ws = new WebSocket('wss://example.now.sh');

    ws.onerror = (e) => {
      // an error occurred
      console.log(e.message);
    };

    ws.onclose = (e) => {
      // connection closed
      console.log(e.code, e.reason);
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions