-
Notifications
You must be signed in to change notification settings - Fork 53
SNI support #17
Description
My app was experiencing timeouts when connecting to some domains. To make a reduced testcase, I started with the 'TCP secure get https website three times'
test (https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-sockets-tcp/blob/master/tests/tests.js#L793). Running that test on my Nexus 5X, by clicking the "Run" button in the test app with only chrome-sockets-tcp selected, I see flakiness, with maybe an 80% success rate. (The second run in particular seems to fail frequently.) I modified the target domain from httpbin.org
to a0.awsstatic.com
, and saw similar results. However, when I changed the target domain to sdk.amazonaws.com
, I saw 100% failure.
In the last case, I set breakpoints to locate the failure. It appears that chrome.sockets.tcp.secure()
never calls its callback, resulting in a test timeout.
The flakiness of the test does not seem surprising. In particular, any nagling or similar aggregation would break the recvCounter
mechanism. However, I'm not aware of any difference between the a0.awsstatic.com
and sdk.amazonaws.com
domains that would logically explain the difference in behavior. (Both domains are hosted on Amazon Cloudfront, so they should behave almost identically.)
The only difference I've been able to find between these domains is that sdk.amazonaws.com
is defined by a CNAME record, whereas a0.awsstatic.com
is defined by an A record. The extra DNS lookup and secondary name should not be a problem, but perhaps a buggy TLS client could fail in this case.