Skip to main content

Posts

Showing posts from July, 2020

How to see if a website supports each TLS version in command line

This is a quick post about checking TLS version support using the command line. Of course, there are plenty of GUI tools and online services to do this. Yet, I find it is much easier to use just a simple command to check this. I'm going to use badssl.com to test this out since it provides various examples with different SSL configurations. We'll be using openssl command to check this. Openssl is a command-line tool to work with SSL connections. If you don't have it in your machine, you'll have to install it first. Let's check a website that supports TLS1.0 TLS 1.0 has been deprecated by all web browsers and servers due to security vulnerabilities in that protocol version which you shouldn't use at all. If you have this enabled in your sever/website, please disable ASAP. openssl s_client -connect tls-v1-0.badssl.com:1010 -tls1 Let's break the command to it's parts openssl : command line tool s_client : s_client is the first command of this t

How to serialize a class with static variables in Java

TL;DR You can't! Instead; Change the static variables into a none static member variable of a singleton class. By making the variables holding class to a singleton, still, it caters to the requirement of keeping your variables having a single reference for the entire application. (This is one of the ways of doing it, surely there are more other elegant ways and crude hacks of doing this depending on the situation) This is a problem that a scholar asked me for some help with. We have a simple use case where there's a configuration class that it requires to hold some values used in application-wide. So the easiest way (not the best) somebody could think would be making the variables static, so it would be only a single reference for it throughout the whole application. Let's imagine the configuration class would look like below. import java.io.Serializable ; public class BranchConfig implements Serializable { private static String branchNa

Wget download pause and continue

If you are downloading a file with the wget command, sometimes you may need to pause it and start it back from the place where you paused rather than starting from the beginning. So you don't have to re-download the entire package. Wget can do this just like downloading from a web browser. Let's say I need to download a file from the web. So I'm using the wget command as follows. Download wget <url for the file> Pause To pause the download just hit ctrl + c  the shortcut to terminate the current command. Continue This is going to be the same command but -c switch to continue from the previous download. wget -c <url for the file> Simple as that! Yeah, you can download from a web browser, but this is more fun and easier 😋 If you are lazy like me, wget saves a couple of clicks.