Skip to content

Instantly share code, notes, and snippets.

View Omnomios's full-sized avatar

Stefan Kent Omnomios

  • ArmouredBeans
  • Sydney
View GitHub Profile
@Omnomios
Omnomios / Ignore certificate for HttpURLConnection in Android.java
Last active February 9, 2023 04:34 — forked from aembleton/Ignore certificate for HttpURLConnection in Android.java
The following code disables SSL certificate checking for any new instances of HttpsUrlConnection wrapped to be used in NativeScript.
/**
* Disables the SSL certificate checking for new instances of {@link HttpsURLConnection} This has been created to
* aid testing on a local box, not for use on production.
*
* Save this file in App_Resources/Android/src/main/java/DevHack.java
*
* Make sure you do a ns clean and rebuild your project
*
* You can call this method in Javascript with com.hack.DevHack.disableSSLCertificateChecking();
*/