GitHub Issue | n/a |
Type | New Feature |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-10-22T08:42:10.000+0000 |
Affected Version/s | n/a |
Fix Version/s | appcelerator.https 2.1.0 |
Components | Https |
Labels | leaf-certificate, trust-chain |
Reporter | David Bankier |
Assignee | Hans Knöchel |
Created | 2017-07-03T02:58:00.000+0000 |
Updated | 2018-08-06T17:49:36.000+0000 |
Basically you currently compare the public key of the provided certificate with the public key of the 0-indexed certificate in the site's certificate chain - the leaf certificate. I would prefer to make the index a variable. That way we can pin to the CA (or intermediate CA) so that the app does not need to be updated with every site's certificate update.
Can you please describe what's exactly is not working when specifying a CA certificate (including an example to reproduce)? Also, is this relevant for both iOS and Android? Please let us know, so we can schedule it, thanks!
Basically you currently compare the public key of the provided certificate with the public key of the 0-indexed certificate in the site's certificate chain - the leaf certificate. I would prefer to make the index a variable. That way we can pin to the CA (or intermediate CA) so that the app does not need to be updated with every site's certificate update. I am happy to implement it my self - it is pretty straight forward - it is just this is a closed source (pro) module.
While we cannot provide the module source, we will be able to implement the feature for you. Would it fit for you to have a third argument passed to
createX509CertificatePinningSecurityManager
calledtrustChainIndex
, defaulting to 0 (leaf) when not set? We would support it for both platforms of course.Sounds good. Thanks.
PR: https://github.com/appcelerator-modules/appcelerator.https/pull/45/ Test-case:
Hans, I'm just looking at the test case for the following snippet:
I'd expect that the
serverCertificate
that would be provided would be the Symantic Class 3 Secure Server CA (intermediate CA) and that it could be reused for other server that are signed with that CA. (Rather than providing the current service certificate). The need for this is that the CAs generally last longer than a server certificate and it avoids the need for timing an update with a certificate update. Does that make sense?[~dbankier] Yes, you are correct. In my case, I'm just assuming the user renames the CA certificate to match the example certificate, but in the end it's all about the certificate itself, not the name :-). *EDIT*: For QE: I've added the
Symantec Class 3 Secure Server CA - G4
certificate that is linked with Wells Fargo.Thank you.
@hknoechel, any chance that I can an early release of the module? I'm happy to run with a beta build. Thanks.
Just checking in to see if there has been any updates. It has been In Review for a couple of months and curious whether it has already been completed and Jira not updated or just forgotten about. Thanks. David
[~dbankier] It is still in review since we had two major releases that intercepted, sorry for that! Let me send you the module via mail today and we update the ticket once 6.3.0.GA is out of the door. *EDIT*: Your JIRA email-address does not seem to exist, please reach out to me via Twitter (@hansemannnn), thx!
Thanks Hans. I just sent you an email. I don't really use twitter anymore.
Got your email, but your provider keeps blocking the response. Sorry ...
My guess is it is a zip file and gmail is blocking it. Can you send me a link? Or share via dropbox (same email address).
Hi Hans, I have been testing the build you sent me and the
trustChainIndex
property doesn't seem to do anything. DavidForget to mention, testing on iOS.
Hans, for the builds you sent me, it works on Android but not on iOS.
Thanks David, we'll revisit iOS! Can you specify what exactly does not work? Does it still select the leaf only? During my testing, I was able to see the CA-cert when selecting a different index which indicated everything works. Did you ensure that the version of the module in your project was updated? *EDIT*: I added some debugging by looping through the available certs:
The second one (index = 1) is selected and the connection gets approved properly.
Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.