-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4.4.1.2 version, with patched SSLConnectionSocketFactory.java to prov…
…ide SNI support on Android
- Loading branch information
Showing
5 changed files
with
31 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
29a30,35 | ||
> import android.os.Build; | ||
> import android.util.Log; | ||
> import android.annotation.TargetApi; | ||
> import java.lang.reflect.InvocationTargetException; | ||
> import java.lang.reflect.Method; | ||
> | ||
138a145 | ||
> public static final String TAG = "SSLConnSockFact"; | ||
393a401,417 | ||
> | ||
> // Android specific code to enable SNI | ||
> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { | ||
> if (Log.isLoggable(TAG, Log.DEBUG)) { | ||
> Log.d(TAG, "Enabling SNI for " + target); | ||
> } | ||
> try { | ||
> Method method = sslsock.getClass().getMethod("setHostname", String.class); | ||
> method.invoke(sslsock, target); | ||
> } catch (Exception ex) { | ||
> if (Log.isLoggable(TAG, Log.DEBUG)) { | ||
> Log.d(TAG, "SNI configuration failed", ex); | ||
> } | ||
> } | ||
> } | ||
> // End of Android specific code | ||
> |