I have tried
from M2Crypto import SSL
handle = url_opener.open(theurl, urllib.urlencode(data), SSL.timeout(120))
also
c = SSL.Connection(ctx)
c.set_socket_read_timeout(SSL.timeout(120))
also
SSL.Connection.set_socket_read_timeout(c, SSL.timeout(120))
I can set the timeout less than 30 seconds but not more than 30 seconds.