wrong ssl logic fix