remove extraneous code
add ssl support