Fixed rare ArgumentException when using SSL