Move ssl functions to new class