title: Plain text authentication: Python
body: <p>I am trying to create a secure connection to Money.net API using user id and pwd but I am not getting any response back from server. I am using Ipython Notebook for development and I am new to world of Programming and Python :)</p>
  
  <pre><code>import socket
  import sys
  Server_address = ('api.data.money.net',50010)
  s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  print sys.stderr, 'connecting to %s port %s' %Server_address
  s.connect(Server_address)
  ####### I pass plain text authentication credentials below #####
  username, password, DATA
  </code></pre>
  
  <p>Nothing happens and server doesn't respond back with 'OK' as expected</p>
  
  <p>I also tried TLS socket.wrap method below but it says "connection timed out"</p>
  
  <pre><code>import socket
  import ssl
  
  # SET VARIABLES
  #packet, reply = "QS MSFT", ""
  HOST, PORT = 'api.data.money.net', 50010
  
  # CREATE SOCKET
  sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  sock.settimeout(30)
  
  # WRAP SOCKET
  wrappedSocket = ssl.wrap_socket(sock,keyfile=None,server_side=0,
                              ssl_version=ssl.PROTOCOL_TLSv1,                                    cert_reqs=ssl.CERT_NONE,do_handshake_on_connect=True)
  
  
  # CONNECT AND PRINT REPLY
  wrappedSocket.connect((HOST, PORT))
  
  
  #Plain Text authentication
  'username','password'
  </code></pre>
  
  <p>I get the response </p>
  
  <pre><code>'username','password'
  </code></pre>
  
  <p>Then i execute the following</p>
  
  <pre><code>packet,reply="QS MSFT",""
  wrappedSocket.send(packet)
  print wrappedSocket.recv(1280)
  </code></pre>
  
  <p>I get the following error in the end</p>
  
  <pre><code>SSLError: ('The read operation timed out',)
  </code></pre>