cacerts now works with openssl

Fixed issue with cacerts where the output stream was not flushed, and
the SD generator was reused across connections.