rough prototype of SSL support