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 :)
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
Nothing happens and server doesn't respond back with 'OK' as expected
I also tried TLS socket.wrap method below but it says "connection timed out"
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'
I get the response
'username','password'
Then i execute the following
packet,reply="QS MSFT",""
wrappedSocket.send(packet)
print wrappedSocket.recv(1280)
I get the following error in the end
SSLError: ('The read operation timed out',)