Retry the SSL handshake up to 10 times.