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

Use TLSv1.2 as minimum SSL/TLS version #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ext{
compileSdk : 28,
gradlePlugin : '2.1.0',
buildTools : '28.0.3',
minSdk : 15,
minSdk : 16,
targetSdk: 28
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public static TrustKit getInstance() {
@NonNull
public SSLSocketFactory getSSLSocketFactory(@NonNull String serverHostname) {
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
sslContext.init(null, new TrustManager[]{getTrustManager(serverHostname)}, null);

return sslContext.getSocketFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class OkHttp2Helper {
@NonNull
public static SSLSocketFactory getSSLSocketFactory() {
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
sslContext.init(null, new X509TrustManager[]{trustManager}, null);

return sslContext.getSocketFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class OkHttp3Helper {
@NonNull
public static SSLSocketFactory getSSLSocketFactory() {
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
sslContext.init(null, new X509TrustManager[]{trustManager}, null);

return sslContext.getSocketFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected final Integer doInBackground(Object... params) {
private static SSLSocketFactory getSystemSSLSocketFactory() {
SSLContext context;
try {
context = SSLContext.getInstance("TLS");
context = SSLContext.getInstance("TLSv1.2");
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException("Should never happen");
}
Expand Down