title: SSL handshake 20s delay to complete process
body: <p>We are experiencing a delay when accessing https:// connection to our server.
  There is a delay around the 20s to display the content of the page which was trace to SSL handshake process</p>
  
  <p>Using </p>
  
  <pre><code>strace -o /tmp/curl.trace.log -f -tt curl -kvv --trace-time https://10.20.23.7:
  </code></pre>
  
  <p>We trace this to </p>
  
  <pre><code>91445 09:22:03.711590 getpeername(3, {sa_family=AF_INET, sin_port=htons(9070), sin_addr=inet_addr("10.20.23.7")}, [16]) = 0
  
  91445 09:22:03.773153 sendto(3, "\26\3\1\0\220\1\0\0\214\3\3\332\3n\204\371\2472v\341E[\2247=2;\336\214\266}\4"..., 149, 0, NULL, 0) = 149
  
  91445 09:22:03.773267 recvfrom(3, 0x1c2b258, 5, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
  91445 09:22:03.773315 poll([{fd=3, events=POLLIN|POLLPRI}], 1, 5000) = 0 (Timeout)
  91445 09:22:08.778047 poll([{fd=3, events=POLLIN|POLLPRI}], 1, 5000) = 0 (Timeout)
  91445 09:22:13.783040 poll([{fd=3, events=POLLIN|POLLPRI}], 1, 5000) = 0 (Timeout)
  91445 09:22:18.787090 poll([{fd=3, events=POLLIN|POLLPRI}], 1, 5000) = 1 ([{fd=3, revents=POLLIN}])
  91445 09:22:20.183606 recvfrom(3, "\26\3\3\n\264", 5, 0, NULL, NULL) = 5
  91445 09:22:20.183724 recvfrom(3, "\2\0\0M\3\3]\312\300\34\367\363\256%V\25s)\tSVX\317*\272=\205(\311\1&lt;\345"..., 2740, 0, NULL, NULL) = 2740
  91445 09:22:20.184242 fcntl(4, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0
  </code></pre>
  
  <p>As I understand recvfrom is not able to read request which was <code>sendto(..)</code></p>
  
  <p>What mean line sendto, where request was sendto?</p>
  
  <pre><code>91445 09:22:03.773153 sendto(3, "\26\3\1\0\220\1\0\0\214\3\3\332\3n\204\371\2472v\341E[\2247=2;\336\214\266}\4"..., 149, 0, NULL, 0) = 149
  </code></pre>
  
  <p>Thank you for info.</p>