-
Notifications
You must be signed in to change notification settings - Fork 12
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
Cert pinning #4
base: master
Are you sure you want to change the base?
Cert pinning #4
Conversation
Thank you very much for your pull request. I tried your source code. However, it is not working on iOS10. For excepting HTTP connection and communicating with a self-signed server, we have to add domain names of the servers to Info.plit with "NSExceptionDomains" key. Also, after version 1.8.9, the app can communicate with AWARE servers without manually installing CRT file. Thank you for your contribution. |
Hi, So, it seems that the root cause is that the Android AWARE protocol won't work - because iOS can't do the first GET /public/server.crt over HTTP. Is this a correct analysis? As work-arounds, could it get the certificate over a different https connection that is signed, and then use that here? Or, could it get the certificate over a HTTPS self-signed connection, using the trust framework to explicitely ignore the signing, and then use that for future connections? I even considered that the certificate could be embedded within the QR code, but that gets to be a lot of data. Could you propose any type of new API for getting the certificate? I can modify my server so that it does it. One thing I have wanted to do is to add query parameters to the study url, such as "https://api.abcd.com?crt=<cert_url>". This way, arbitrary other data could be passed to the app when scanning the URL, and we can handle extending the protocol more easily. What do you think? Thanks,
|
Hi @rkdarst ,
Yes. We should make a new function for iOS client. I guess that predicting the URL (for downloading .crt) is difficult from parameters to the study URL. So, we should add a new function to a QRcode reader for downloading a .crt file from other servers through "https." For example,
Best regards, |
@tetujin That certainly solves the problem with getting crt file but there should still be a way to make sure the file is not mangled with in the process before we can actually validate the connection. That could be solved by including a |
Despite all this, since I cannot currently test on iOS10, I have to confirm that the certificate pinning part still works as expected. That is, the API used to extract certificate from the challenge (e.g. here). I just tested this on latest iOS 9 update and it works here. |
Hi @arashbm, I would like to confirm your idea. In you idea, the QR code has public key(.crt) information with URL for a study?
Maximally, QR can store 4296 alphanumerics. Also, I counted a length of the URL experimentally. The length is almost 1200 characters. Thanks, |
Hi, This would be very nice. I'll work on adding support to the Android one, but I may not get to it for some time. Once we do this, we can have these keys (do we start with the first?):
With Android, the trick is that this URL used to be used directly as the Thanks,
|
Hum... this is an interesting approach to get the certificates bundled within the QRCodes. I vote for support on Android side too. |
By the way: this is almost done for Android. I have implemented all three parameters, |
Hi,
This is the work by @arashbm to do SSL cert pinning like the Android aware client. It is for an older version and would take some time to rebase (and probably not all is needed), however, I'm putting it here so you can see.
With this, with latest development tools (though I'm not sure what iOS version), we could pin the certificate in the same form as Android, with no advance loading of the certificate while developing the app.
Here is a partial quote from @arashbm, hopefully he can reply with more details:
What do you think? Can you see if this code is still valid on iOS 10, and maybe even forward port it faster?
Thanks,