Comments (3)
Did you ever figure this out?
from androidpinning.
As of now what I do as a workaround is to run a separate thread every 30 seconds which will send a Pinned request using Android's native SSL library. So if anything goes wrong, It will kill the app.
Here is the Sample code.
try {
String[] pins = "pin_here";
URL url = new URL("URL_here");
HttpsURLConnection connection = PinningHelper.getPinnedHttpsURLConnection(getBaseContext(), pins, url);
byte[] data = new byte[4096];
connection.getInputStream().read(data);
YLog.i("SSL", "Success " + new String(data));
}
catch (SSLKeyException e) {
android.os.Process.killProcess(android.os.Process.myPid());
}
catch (SSLHandshakeException e) {
android.os.Process.killProcess(android.os.Process.myPid());
}
catch (SSLProtocolException e) {
android.os.Process.killProcess(android.os.Process.myPid());
}
catch (SSLPeerUnverifiedException e) {
android.os.Process.killProcess(android.os.Process.myPid());
}
catch (IOException ioe) {
YLog.i("SSL", "IOException: Not Success: " + ioe.getMessage().toString());
} catch (StringIndexOutOfBoundsException sio) {
YLog.i("SSL", "StringIndexOutOfBoundsException: Not Success: " + sio.getMessage().toString());
}
catch (Exception e) {
YLog.i("SSL", "Exception: Not Success: " + e.getMessage().toString());
}
from androidpinning.
Ah ok, your volley request queue is using the default http stack which uses the singleton. My volley instance is using Okhttp. OkHttp creates it's own httpclient (separate ssl context). I think all I need to do is to set the SSLSocketFactory for the OkHttpClient befor passing it to the volley.newRequestQueue.
from androidpinning.
Related Issues (20)
- aild => aidl?
- Externalize hashing and certificate logic to enable alternative implementations
- SSL Pinning for WebView? HOT 3
- GPL vs. LGPL? HOT 1
- Generate pin without M2Crypto python module HOT 1
- build.gradle error
- Support SHA-2 HOT 1
- Check for trustedChain in CertificateChainCleaner
- How does one obtain Google's X.509 certificate?
- Dependencies deprecated in API 22
- Support SHA2
- Add domain to compare each PIN against
- Use of BKS
- Pinning the .crt file
- insecure pinning
- Can't Find Your Email - So Contacting via Github Issue lol
- Edge case on API < 16 HOT 4
- AndroidPinning License HOT 1
- getPinnedHttpsUrlConnection seems to leak sockets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androidpinning.