question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TLS EncryptedSocket timeout error

See original GitHub issue

I’m been trying to get TLS to work with SQL in Azure. I ran into this issue when I pass in:

cafile = '/etc/ssl/certs/ca-certicates.crt'
validate_host = False

Then the following error rises:

  File "/home/vagrant/.virtualenvs/project/lib/python2.7/site-packages/pytds/tds.py", line 1209, in commit
    prev_timeout = self._tds.sock.gettimeout()
AttributeError: 'EncryptedSocket' object has no attribute 'gettimeout'

I tracked it down and it looks like all references to gettimeout and settimeout are being done against the EncryptedSocket object rather than the transport property. I added pass through methods to avoid breaking further code but that seemed to correct the errors and could connect successfully to Azure.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
denisenkomcommented, Feb 10, 2018

New version is uploaded to pypi - 1.9.1 with a fix, kudos to @radyz

1reaction
eydelriverocommented, Feb 8, 2018

Hi @denisenkom ! If I use validate_host=True, the same certificate no longer works. It throws Exception: Certificate does not match host name 'redacted_host_name.database.windows.net' when trying to connect. Any thoughts on how to make it work with validate_host=True?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transport Layer Security (TLS) connections might fail or ...
When attempting to connect, Transport Layer Security (TLS) might fail or timeout. You might also receive one or more of the with the...
Read more >
TLS connection timeout vs TCP connection timeout
I understand that if the TCP connection is closed then the TLS connection is closed too. But what would happen if the TCP...
Read more >
Rehash: How to Fix the SSL/TLS Handshake Failed Error
The TLS Handshake Failed error can originate from the client or the server, here's a guide for fixing the problem for both users...
Read more >
What causes a TLS handshake timeout? - Quora
The default timeout is ten seconds. Stalled connections can be caused by configuration or application protocol mismatches. How do I fix the TLS...
Read more >
AT-TLS handshake timeout - IBM
This is an integer from 1 to 600 that specifies the number of seconds to wait for the secure handshake to be initiated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found