add SSL support

Adding SSL support.
Tested against stunnel on the server side.
Using:
  System.setProperty("javax.net.ssl.trustStore", "Truststore.jks");
  System.setProperty("javax.net.ssl.trustStorePassword", "mypassword");
  System.setProperty("javax.net.ssl.trustStoreType", "jks");
Once the pull request is accepted, i'll put some how-to in the wiki.