Skip to content

Commit 527096f

Browse files
committed
4.3.6.1 version, with patched SSLConnectionSocketFactory.java to provide SNI support on Android
1 parent 6e9460f commit 527096f

4 files changed

Lines changed: 31 additions & 3 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
}
55

66
dependencies {
7-
classpath 'com.android.tools.build:gradle:1.3.1'
7+
classpath 'com.android.tools.build:gradle:1.5.0'
88
}
99
}
1010

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ ${SED_CMD} "s/sedpackage/cz\.msebera\.httpclient\.android/g" src/main/AndroidMan
243243

244244
cd ${ANDROIDPROJECTPATH}
245245
patch ${PACKAGEDIR}/conn/ssl/AbstractVerifier.java ../patches/AbstractVerifier.java.patch.4.3.5
246+
patch ${PACKAGEDIR}/conn/ssl/SSLConnectionSocketFactory.java ../patches/SSLConnectionSocketFactory.java.patch.4.3.5
246247

247248
echo ">> Gradle build proceed"
248249
if [ ${INCLUDE_JGSS_API} -eq 1 ]; then

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_NAME=4.3.6
2-
VERSION_CODE=436
1+
VERSION_NAME=4.3.6.1
2+
VERSION_CODE=437
33
GROUP=cz.msebera.android
44

55
POM_ARTIFACT_ID=httpclient
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
29a30,35
2+
> import android.os.Build;
3+
> import android.util.Log;
4+
> import android.annotation.TargetApi;
5+
> import java.lang.reflect.InvocationTargetException;
6+
> import java.lang.reflect.Method;
7+
>
8+
121a128
9+
> public static final String TAG = "SSLConnSockFact";
10+
289a297,313
11+
>
12+
> // Android specific code to enable SNI
13+
> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
14+
> if (Log.isLoggable(TAG, Log.DEBUG)) {
15+
> Log.d(TAG, "Enabling SNI for " + target);
16+
> }
17+
> try {
18+
> Method method = sslsock.getClass().getMethod("setHostname", String.class);
19+
> method.invoke(sslsock, target);
20+
> } catch (Exception ex) {
21+
> if (Log.isLoggable(TAG, Log.DEBUG)) {
22+
> Log.d(TAG, "SNI configuration failed", ex);
23+
> }
24+
> }
25+
> }
26+
> // End of Android specific code
27+
>

0 commit comments

Comments
 (0)