1

I am trying to access this site with Python Httplib2:

https://www.talkmore.no/talkmore3/servlet/Login

But I get this error:

httplib2.SSLHandshakeError: [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

This is the python code I use:

login = "user"
pwd = "pass"
headers = {'Content-type': 'application/x-www-form-urlencoded'}
data = {'username':login, 'password':pwd}
h = httplib2.Http(".cache", disable_ssl_certificate_validation=True)

resp, content = h.request("https://www.talkmore.no/talkmore3/servlet/Login", "POST", urlencode(data))

I have tried with other libraries, but the same error occurs..

EspenG
  • 537
  • 3
  • 10
  • 20
  • 1
    You should use the `REQUESTS` library. It's way better than `HTTPLIB` and it supports `SSL`. This code would be MUCH simpler using requests! – Charles D Pantoga Aug 17 '15 at 16:31
  • I got the same error with requests.. – EspenG Aug 17 '15 at 16:33
  • I wasn't saying that `requests` would solve the error, I was saying that requests is a better library. – Charles D Pantoga Aug 17 '15 at 16:45
  • Have you tried your code to connect (not necessarily login) to other sites that should work - google.com, microsoft.com, etc.? Also, before anyone else says it, you shouldn't really disable ssl certificate validation when accessing internet sites - because it is a) a security risk and b) should not be needed - of course for intranet neither of these are likely to be a porblem. – DisappointedByUnaccountableMod Aug 17 '15 at 17:04
  • Googling for SSL23_GET_SERVER_HELLO turns up this http://stackoverflow.com/questions/15421050/node-request-getting-error-ssl23-get-server-hellounknown-protocol - have you tried looking for that error message? – DisappointedByUnaccountableMod Aug 17 '15 at 17:12

1 Answers1

0

The server itself is fine and supports TLS1.0...TLS1.2 (but no SSL 3.0). It also supports commonly used ciphers and using your python code gives no errors for me. This means that you either have some old and buggy version of python/OpenSSL installed (details for versions are missing in the question) or that there is some middlebox in between which stops the connection (i.e. firewall or similar).

Please try to access the same https-site with a normal browser from the same machine to see if you get the same problems. If yes then there is some middlebox blocking the data. If the browser succeeds please make a packet capture (with tcpdump or similar) to look at the differences between the data sent by the browser and your test program and thus narrow down what the underlying problem might be.

Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172