Commit graph

16 commits

Author SHA1 Message Date
Tarjei Husøy
1cb092dd73 Hard-code cert in script
Makes it easier to copy over just the script instead of having to
clone the repo. Standalone is nice.
2016-06-04 00:03:05 -07:00
Tarjei Husøy
ed50d9deac Order imports alphabetically 2016-06-03 23:54:44 -07:00
Tarjei Husøy
8ec2e9de4e Clarify what's happening in intro docs 2016-06-03 23:53:18 -07:00
Tarjei Husøy
4bad8cf825 Use .recv instead of .read 2016-06-03 20:34:09 -07:00
Tarjei Husøy
66bbfc4141 Pick best available protocol on server 2016-06-02 12:12:23 -07:00
Tarjei Husøy
792c55dfbc Remove unused import 2016-06-02 12:12:23 -07:00
Tarjei Husøy
dcf90c1203 Remove our auth success response
We let the actual server reply with this directly.
2016-06-02 09:02:15 -07:00
Tarjei Husøy
bb107c9074 Buffer reads/writes to server
Now ensures entire packet is sent by using .sendall() on the socket,
and actually reads the auth request packet properly.

Also quits earlier, after sending the auth response we now connect
the socket directly, letting the server reply success to the client.
2016-06-02 09:01:11 -07:00
Tarjei Husøy
63e55c4260 Remove unread bytes shenanigans
Read directly into buffer instead, should not read more than
wait we're waiting for.
2016-06-02 08:57:34 -07:00
Tarjei Husøy
0a7d73bc83 Run initiation under try/except
Ensures that connection is closed if errors occur here.
2016-06-02 08:56:04 -07:00
Tarjei Husøy
f1094961ba Handle packet fragmentation more robustly
Not the most effective, but it shouldn't fall over itself if faced
with fragmented packets.

Doesn't properly initiate plaintext connections yet, need some more
debugging to figure out what's up with that. Might be due to using
.read on a non-SSL socket.

Remaining items for robustness:
  - Make sure .send sends the entire message (or does SSL sockets
    handle that for us?)
  - Handle potential fragmentation when establishing server
    connection
2016-05-30 23:34:13 -07:00
Tarjei Husøy
878310d3e1 Close client connections if main thread is stopped 2016-05-30 21:18:54 -07:00
Tarjei Husøy
8a59115cad Document where the magic SSL request came from
Closes #1.
2016-05-30 20:35:12 -07:00
Tarjei Husøy
f5de37b0f5 Add warning about socket code 2016-05-30 08:36:46 -07:00
Tarjei Husøy
c63c5d2f3b Slightly better closing of sockets 2016-05-30 08:35:03 -07:00
Tarjei Husøy
a2a19616fc Add first draft of script 2016-05-30 07:31:26 -07:00