Android HttpClient and HTTPS

This should get you started. I’m using basically the same, except with ThreadSafeClientConnManager. SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme(“https”, SSLSocketFactory.getSocketFactory(), 443)); HttpParams params = new BasicHttpParams(); SingleClientConnManager mgr = new SingleClientConnManager(params, schemeRegistry); HttpClient client = new DefaultHttpClient(mgr, params);

Using HTTPS with REST in Java

When you say “is there an easier way to… trust this cert”, that’s exactly what you’re doing by adding the cert to your Java trust store. And this is very, very easy to do, and there’s nothing you need to do within your client app to get that trust store recognized or utilized. On your … Read more

Configuring MAMP for SSL

If you’re using MAMP 3 or 4 the instructions are slightly different. Here’s what worked for me, starting from a fresh install of MAMP 3.0.5 on Mavericks without Pro. Update: Still works on Yosemite after fixing Apache as described in this answer. Further Update: Comments suggest this still works at least through MAMP 5.4. Generate … Read more

How can I implement SSL Certificate Pinning while using React Native

After exhausting the current spectrum of available options from Javascript I decided to simply implement certificate pinning natively it all seems so simple now that I’m done. Skip to headers titled Android Solution and IOS Solution if you don’t want to read through the process of reaching the solution. Android Following Kudo’s recommendation I thought … Read more

How to pin the Public key of a certificate on iOS

In case you are in need of knowing how to extract this information from the certificate in your iOS code, here you have one way to do it. First of all add the security framework. #import <Security/Security.h> The add the openssl libraries. You can download them from https://github.com/st3fan/ios-openssl #import <openssl/x509.h> The NSURLConnectionDelegate Protocol allows you … Read more

Error “You’re accessing the development server over HTTPS, but it only supports HTTP”

I think you should create different settings.py ( base_settings.py, local_settings.py, production_settings.py). And in your settings.py do something like this: import socket if socket.gethostname()==”Raouf-PC”: from local_settings import * Change ‘Raouf-PC’ to the hostname of your PC. P:S: I’m using Windows 10. After doing that place the below data in your production_settings.py and save. Then clear your … Read more

Ignore self-signed ssl cert using Jersey Client [duplicate]

After some searching and trawling through some old stackoverflow questions I’ve found a solution in a previously asked SO question: Question: Java client certificates over HTTPS/SSL Answer Java client certificates over HTTPS/SSL Here’s the code that I ended up using. // Create a trust manager that does not validate certificate chains TrustManager[] trustAllCerts = new … Read more

Which versions of SSL/TLS does System.Net.WebRequest support?

When using System.Net.WebRequest your application will negotiate with the server to determine the highest TLS version that both your application and the server support, and use this. You can see more details on how this works here: http://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_handshake If the server doesn’t support TLS it will fallback to SSL, therefore it could potentially fallback to … Read more