Posts

Showing posts from May, 2018

Android, Self-Signed Certificates and OkHttp

Image
Just recently I have been writing a private Android application using the latest freshness that is Kotlin . Of course, like all mobile applications, it makes heavy use of HTTP requests, sending data back and forth between my app and the back-end API. Because this app is private, it will never be released in the Google Play store and the back-end server will not be publicly available on the internet. The server is a private home web server on an internal network (think intranet) and the application will only contact it over my home WiFi. Did you know that Sensitive Data Exposure is still on the 2017 OSWASP top 10 list ? It's currently sitting at the #3 spot. The OSWASP folks say: "Over the last few years, this has been the most common impactful attack. The most common flaw is simply not encrypting sensitive data." So, as a good developer, my next job was to switch my project to use HTTPS/TLS . That's when I remembered Let’s Encrypt which is a free , auto

Excel Interop & C#

Image
If you've ever developed even a small line-of-business application, sooner or later, you know your users are going to ask: "Erm... This is great and everything but can we get this data exported to excel?" Now, of course, exporting data to Excel has always been possible and back in the day, you would use COM Interop to create an Excel file using C# but... how do I put this? - Let's just say it wasn't pretty! Take this small snip of code for example: private void ExcelTest() { object mMissingValue = System.Reflection.Missing.Value; Application excelApp = new Application(); // Open the file Workbook workBook = excelApp.Workbooks.Open(templatePath, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissingValue, mMissingValue); Worksheet sheet = (Worksheet)workBook .Wor