Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impr(android): implement TLSv3 support #11195

Merged
merged 12 commits into from Sep 18, 2019
Merged

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Sep 4, 2019

  • Implement TLSv3 support into Titanium.Network
TEST CASE
const win = Ti.UI.createWindow({ backgroundColor: 'gray' });
const lbl = Ti.UI.createLabel({ text: 'Loading...' });

const client = Ti.Network.createHTTPClient({
    onload: e => {
        const html = e.source.responseText;

        if (html.includes('protocol_tls1_3">Yes')) {
            lbl.text = 'TLSv3: Supported';
            lbl.color = 'green';
        } else {
            lbl.text = 'TLSv3: Unsupported';
            lbl.color = 'red';
        }
    },
    onerror: e => {
        lbl.text = 'Could not determine TLSv3 support!';
        lbl.color = 'red';
    },
    timeout: 8000
});
client.open('GET', 'https://ssllabs.com/ssltest/viewMyClient.html');
client.send();

win.add(lbl);
win.open();

JIRA Ticket

@garymathews garymathews added this to the 8.3.0 milestone Sep 4, 2019
@build build requested review from a team September 4, 2019 23:47
@build build added the docs label Sep 4, 2019
@build
Copy link
Contributor

build commented Sep 4, 2019

Messages
📖

💾 Here's the generated SDK zipfile.

📖

✅ All tests are passing
Nice one! All 4373 tests are passing.
(There are 475 tests skipped)

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.

Generated by 🚫 dangerJS against 08cba01

@jquick-axway jquick-axway self-requested a review September 5, 2019 18:13
@sgtcoolguy sgtcoolguy changed the base branch from 8_3_X to master September 9, 2019 18:04
@sgtcoolguy sgtcoolguy changed the title impr(android)(8_3_X): implement TLSv3 support impr(android): implement TLSv3 support Sep 9, 2019
Copy link
Contributor

@sgtcoolguy sgtcoolguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a unit test that automates the exact test case you pasted in manually.

/* eslint-env mocha */
/* eslint no-unused-expressions: "off" */
'use strict';
var should = require('./utilities/assertions');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ tests/Resources/ti.network.httpclient.addontest.js line 10 – 'should' is assigned a value but never used. (no-unused-vars)

}
},
onerror:
e => { finish(new Error('Could not determine TLSv3 support.')); },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ tests/Resources/ti.network.httpclient.addontest.js line 29 – 'e' is defined but never used. Allowed unused args must match /^_.+/u. (no-unused-vars)

@jquick-axway
Copy link
Contributor

jquick-axway commented Sep 11, 2019

@garymathews, maybe we should add the TLS_VERSION_1_3 constant to our iOS code in this PR as well. It turns out our iOS code never uses these constants; it only defines them.
https://github.com/appcelerator/titanium_mobile/blob/16f04c5a2437a948b6cbd3895421035a4c180983/iphone/Classes/NetworkModule.h#L19-L24
https://github.com/appcelerator/titanium_mobile/blob/16f04c5a2437a948b6cbd3895421035a4c180983/iphone/Classes/NetworkModule.m#L196-L198

The rest of your changes look fine. Thanks!

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: Pass

@build build added the ios label Sep 13, 2019
@ssekhri
Copy link

ssekhri commented Sep 18, 2019

FR Passed.
The response text for httpclient request to a TLS test page returns success for TLS1.3 on Android Q emulator. For older Android versions the TLS1.3 support is returned as false.
Also when tlsVersion is set to 1.2 for httpclient then the response text returns false on Android Q emulator as well.
Verified on:
Mac OS 10.14.6
Ti SDK: 8.3.0.v20190913134535
Appc CLI: 7.1.1
Node: 10.5.0
JDK: 10.0.2
Studio: 5.1.4.201909061933
Device: Pixel2 emulator (10.0), Pixel2 emulator (8.0.0)

@ssekhri ssekhri merged commit c9098a8 into tidev:master Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants