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

Fix tls version #1133

Closed
wants to merge 1 commit into from
Closed

Fix tls version #1133

wants to merge 1 commit into from

Conversation

JohannesKuehnel
Copy link
Contributor

Removed static libraries and added Maven entries
Added latest OkHttp library as source code and forced TLSv1.2
Fixed OkHttp API changes vom v1 to v2
Added OkHttp enforcing to doHttps-Methods (consistency)
Fixed resource reporting for Bricks

Test run: https://jenkins.catrob.at/view/All-Categories/view/Experimental/job/Catroid-Multi-Job-Custom-Branch-RELOADED/480/
https://jenkins.catrob.at/job/CatroidDeviceTest/563/

fixed required brick resources

removed System.out.println() in OkHttp-library source

excluded OkHttp from pmd checks & added copyright

suppressed lint warnings in OkHttp
@aried3r
Copy link
Contributor

aried3r commented Oct 28, 2014

Why add the source code instead of adding

compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'

to the build.gradle file?

@aried3r
Copy link
Contributor

aried3r commented Oct 28, 2014

Well, I'm guessing because you want to disable SSLv3 because of POODLE, but where in the code did you apply your own changes?

@JohannesKuehnel
Copy link
Contributor Author

As I've discussed with Ajdin and others already, that's something I've already tried but the problem is the OkHttp library is using SSLContext.getInstance("TLS") which calls the API's default TLS setting (only API level 20 has TLSv1.2 as its default) and therefor fails to connect to the testserver (which has TLS below 1.1 as well as SSL3 disabled).

Changes have been applied to several files due to Maps, Lists and so on missing Datatypes in their "<>", System.out.println() etc. The relevant change, however, is in OkHttpClient.java - getDefaultSSLSocketFactory(), where I've changed "TLS" to "TLSv1.2".

One could also make a single library jar with the edited files. This would result in a minor pull request.

@aried3r
Copy link
Contributor

aried3r commented Oct 28, 2014

Would the code in this comment work for us using the gradle dependency?

@JohannesKuehnel
Copy link
Contributor Author

Styp was working on this today. Dunno if he finally succeeded.

Anyway, Android APIs below 16 don't support TLSv1.1+, which might be a problem once we upgrade the production server, since Pocket Code officially works with 10+.
https://developer.android.com/reference/javax/net/ssl/SSLSocket.html

@SimonStefan
Copy link
Contributor

easier fix with e23ade4 will be committed soon to master

@SimonStefan SimonStefan closed this Nov 5, 2014
@JohannesKuehnel JohannesKuehnel deleted the fixTlsVersion branch February 25, 2015 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants