Fix and add some minor changes to XML extSource

 - add optional parameter "header" to SSL connection
 - fix closing of SSL connection