Quantcast
Viewing all articles
Browse latest Browse all 1519

Python Sockets Specify Signature Algorithm in Client Handshake

I'm currently writing my own https webserver at home which complies with (or will comply with, when I'm done with it, as I'm writing the webserver in C++) TLS 1.3. I have a Python client that I want to connect to this webserver. The webserver in question will only support elliptic curves (specifically ecdsa_secp256r1_sha256​) for the signature algorithm, which gets sent in the initiating client_handshake record.I want to connect to this https webserver via a Python client, and then issue an HTTP request (either GET or POST) to said server. Only problem is, I haven't the foggiest idea how to configure the signature algorithm for client socket connections in Python.

I've checked out the PyCryptoDome library (https://www.pycryptodome.org/src/signature/dsa) which seems to allow for the functionality that I need, but I haven't a clue how to integrate it with utilities such as urllib3's request function (which is what I had been using for testing purposes so far), or any similar.

I checked out http.client, but almost immediately ruled it out as it's far too simple of an implementation to allow for such a deep level of customisation.

I've also considered simply raw-dogging HTTP request headers and using sockets, so I checked out the SSL library for Python (https://docs.python.org/3/library/ssl.html#tls-1-3), and it explicitly states at the bottom that they don't support signature algorithm configuration as of yet (unless I completely misread it).

I'm at a complete loss at this point. Any help would be appreciated.


Viewing all articles
Browse latest Browse all 1519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>