title: SSL error with using multiprocessing and sockets
body: <p><strong>Python Version:</strong> 3.4.3</p>
  
  <p><strong>Arch Linux:</strong> 4.1.3-1-ARCH</p>
  
  <p>I am getting this error when using a socket wrapped with the SSL module:
  <code>ssl.SSLError: [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:1769)</code></p>
  
  <p>Things you might need to know. I get this error when I pass a method to a multiprocess. I have a base class irc, my bot inherits irc and the bot is the one who passes the method off to the process as an argument. I am trying to make an irc bot that can use a plug-in type system. </p>
  
  <p>I think I narrowed down to the socket closing after it goes to the multiprocess. However, <strong>this only happens when SSL is used.</strong></p>
  
  <p><a href="http://pastebin.com/tSU5jBSv" rel="nofollow">Here is the pastebin</a> of what I think could be wrong that you would need to know.</p>
  
  <p><strong>IRC SSL error</strong></p>
  
  <p>This happens after I send a command/plugin/addon to be used as <code>multiprocessing check[3].main</code> has been dynamically loaded as a module and <code>.mai</code>n is a function in that module, the connection closes. Normal sockets with no SSL works just fine and as intended, only if it's wrapped in SSL it seems to close the connection?</p>
  
  <pre><code>ssl.SSLError: [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:1769)
  
  com_process = multiprocessing.Process(target=check[3].main, args=(check[0], check[1], check[2], self.sendIrc))
  
  sendIrc is only being used as below in another class we have inherited from.
  def sendIrc(self, data):
      if type(data) == str:
          self.sendData("PRIVMSG %s :%s\r\n" % (self.channel, data))
          return
  
  sendData encode as utf-8 because python3:
  def sendData(self, data):
      self.sock.send(data.encode('utf-8'))
  </code></pre>
  
  <p><code>check[3].main</code> points to this module that has been dynamically loaded and ran under the multiprocessing:
      import time</p>
  
  <pre><code>def main(nick, comargvs, chan, send):
      print(nick, comargvs, chan)
      time.sleep(5)
      send("Success!")
  </code></pre>
  
  <p>After this is tun, the parent or calling main code gets the error I posted, but only when SSL is used.</p>
  
  <p>And here is <a href="https://github.com/nulldigit90/TechBot/tree/master/ircbot" rel="nofollow">the GitHub Repository of the bot</a> if you needed more info on how it works. I only use <code>!test</code> or <code>test.py</code> in <code>addons</code> to reproduce the error with and only with SSL, i.e. <code>ssl = True</code> in the config file, when SSL is disabled it works just fine and as expected.</p>
  
  <p>This issue didn't happen until I started passing <code>ircSend</code> to the <code>plugins/addons</code>, when they die so does the socket in SSL. I was using queues before but decided to use this way of doing it.</p>
  
  <p>Any help or why this error is being thrown or why it's only happening with SSL would be great.</p>