Python Forum
Problem connecting TLS client written in C++ and Twisted server
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem connecting TLS client written in C++ and Twisted server
#1
Bug 
I'm trying to get a TLS (encrypted) connection between a client program written in C++ using the Boost::Asio framework and a server written using the Twisted framework in Python. I can connect to the server using a client written using Twisted and the C++ program can talk to a C++ TLS server written with Boost. The problems seem to arise from using the two together. When I try connecting to the server the connection dies with this kind of error. I've tried basically every setting for the SSL context in Boost and a number of other settable options. One odd thing that I can tell you right now is that setting options like boost::asio::ssl::context::no_sslv3 still produces the same error. I'm assuming the Boost library doesn't ignore its own settings so I'm wondering why our Twisted server is complaining about a protocol it shouldn't be using.

[c 2022-06-12 00:47:05.328804] connectionLost reason: [Failure instance: Traceback: <class 'OpenSSL.SSL.Error'>: [('SSL routines', 'ssl3_get_record', 'decryption failed or bad record mac')]
/home/greg/vast-dev_gp3/ve/lib/python3.6/site-packages/twisted/internet/posixbase.py:614:_doReadOrWrite
/home/greg/vast-dev_gp3/ve/lib/python3.6/site-packages/twisted/internet/tcp.py:243:doRead
/home/greg/vast-dev_gp3/ve/lib/python3.6/site-packages/twisted/internet/tcp.py:249:_dataReceived
/home/greg/vast-dev_gp3/ve/lib/python3.6/site-packages/twisted/protocols/tls.py:330:dataReceived
--- <exception caught here> ---
/home/greg/vast-dev_gp3/ve/lib/python3.6/site-packages/twisted/protocols/tls.py:274:_flushReceiveBIO
/home/greg/vast-dev_gp3/ve/lib/python3.6/site-packages/OpenSSL/SSL.py:1783:recv
/home/greg/vast-dev_gp3/ve/lib/python3.6/site-packages/OpenSSL/SSL.py:1639:_raise_ssl_error
/home/greg/vast-dev_gp3/ve/lib/python3.6/site-packages/OpenSSL/_util.py:54:exception_from_error_queue
]
~Greg
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Paramiko Server -- Exception (server): Error reading SSH protocol banner ujlain 3 4,557 Jul-24-2023, 06:52 AM
Last Post: Gribouillis
  Asyncio | Websockets - general problem starting the server dreamer 5 3,261 Oct-26-2022, 11:55 AM
Last Post: dreamer
  Client/Server proper finalizing transfer wolfman5874 1 1,461 Jul-04-2022, 07:35 PM
Last Post: wolfman5874
  Socket server problem H84Gabor 0 1,251 Jun-21-2022, 12:14 AM
Last Post: H84Gabor
  Server/client basic communication ebolisa 0 2,032 Sep-30-2021, 12:22 PM
Last Post: ebolisa
  Client server Multithreading Anan 6 5,892 Apr-21-2021, 08:19 PM
Last Post: SheeppOSU
Question Trouble with Client/Server reverse Shell! Gilush 0 2,790 Feb-03-2021, 01:04 PM
Last Post: Gilush
  Basic client server code question swisscheese 4 3,248 Dec-12-2020, 08:51 AM
Last Post: Larz60+
  How can i create a server for already existing client using Python? Chapanson 21 7,495 Aug-19-2020, 09:12 AM
Last Post: DeaD_EyE
  Simple TCP Client and TCP Server Problem Vapulabis 5 4,402 Jul-12-2020, 05:09 PM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020