title: MariaDB client connection aborted after 60 sec. Seems to relate to SSL. Would like to find out why
body: <p>I'm running MariaDB v10.0.14 on a Windows 2012R2 Server, and I work locally from a Win7 machine. I'm limiting this problem to using the command line client tool. I am encrypting the connection to the server DB with SSL. I can connect and issue commands, however after being idle for 60s I get:</p>
  
  <p><code>ERROR 2013 (HY000): Lost connection to MySQL server during query</code></p>
  
  <p>When I re-issue the command I get:</p>
  
  <p><code>ERROR 2006 (HY000): MySQL server has gone away.
  No Connection. Trying to reconnect...</code></p>
  
  <p>Then the client reconnects and runs the command. I don't know why this is occurring and am worried it may affect DB users' connections. Some troubleshooting:</p>
  
  <ul>
  <li>When I connect without SSL this does not occur</li>
  <li>I have been ignoring this issue for a while so can not say what change may have led to this. I certainly remember connecting with SSL in the past and not having these timeouts.</li>
  <li>I can RDP to the server, connect to DB with command line tool and SHOW FULL PROCESSLIST. I can see the localhost connection plus the remote client connection. When the client has just been started I see Command as 'Sleep' and State as 'cleaning up'. I can issue commands from the client. When Time > 60 State changes to Null and the client shows the above symptoms.</li>
  <li>I've read through <a href="https://dev.mysql.com/doc/refman/5.0/en/communication-errors.html" rel="nofollow noreferrer">this</a>, tried all standard suggestions but can't even seem to find any mention of this behaviour. Is it normal?</li>
  <li>Wait_timeout and interactive_timeout are set at 28800 so I don't think this is the problem.</li>
  <li>net_read_timeout=30 and net_write_timeout=60 but these are tiny commands</li>
  <li>connect_timeout=10 but connection is not the issue.</li>
  <li>Credentials and permissions are fine as I can connect originally.</li>
  <li>Error log has entries corresponding to this event as:
  <code>Aborted connection xxx to db: &lt;dbname&gt; user: '&lt;user&gt;' host: '&lt;host&gt;' (Unknown Error)</code></li>
  <li>Firewall logs show that traffic seems to be flowing just fine.</li>
  <li>I took a capture of network traffic on the server and saw the below. The blue is the original connection. In orange you can see that at 73s I issue a new command which is met in red with [FIN, ACK] then [RST, ACK] from the server. The green afterward is when the command is reissued and the reconnection occurs. Note the change in client port. Handshakes seem to be fine. Beyond that I'm lost. I'm a data guy, not a network guy.
  <a href="https://i.stack.imgur.com/P7txu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P7txu.png" alt="Connection and sleep traffic"></a></li>
  </ul>
  
  <p>Anyone have any insights or ideas? Thanks.</p>
  
  <p>Output for
  <code>show variables like '%timeout%';</code></p>
  
  <p>(can't post more than 2 links. I should answer some questions)</p>
  
  <p>connect_timeout=10</p>
  
  <p>deadlock_timeout_long=500000000</p>
  
  <p>deadlock_timeout_short=10000</p>
  
  <p>delayed_insert_timeout=300</p>
  
  <p>innodb_flush_log_at_timeout=1</p>
  
  <p>innodb_rollback_on_timeout=OFF</p>
  
  <p>interactive_timeout=28800</p>
  
  <p>lock_wait_timeout=31536000</p>
  
  <p>net_read_timeout=30</p>
  
  <p>net_write_timeout=60</p>
  
  <p>slave_net_timeout=3600
  wait_timeout=28800</p>