add ssl exception handling