Set the correct string length

STARTTLS failed in some cases because the string length was not set correctly (20 bytes instead of 18).
My small refactoring helps to avoid such mistakes.