Formatting

This commit is contained in:
2023-09-16 16:51:31 -04:00
parent 0a64bb27ba
commit b25f464a04
13 changed files with 31 additions and 18 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""crypto_server.py
"""generate_server_keys.py
----------------
This module contains utilities for generating and storing server keys and

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
"""
"""secure_client.py
----------------
A module to establish a non-verifying SSL connection with a server and to
send/receive messages through a secure socket.
@ -21,10 +22,10 @@ def main(server_address: str, server_port: int):
context = SSLContext(PROTOCOL_TLS_CLIENT)
context.check_hostname = False
context.verify_mode = CERT_NONE
unsecure_socket: socket = create_connection(
(server_address, server_port)
)
secure_socket = context.wrap_socket(unsecure_socket) #, server_hostname="localhost")
unsecure_socket: socket = create_connection((server_address, server_port))
secure_socket = context.wrap_socket(
unsecure_socket
) # , server_hostname="localhost")
while True:
message = input()
@ -36,4 +37,4 @@ def main(server_address: str, server_port: int):
if __name__ == "__main__":
main("127.0.0.1", 9001)
main("127.0.0.1", 9001)

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
"""
"""secure_server.py
----------------
This module facilitates creating an asynchronous SSL server that echoes
received messages. The server operates using SSL certificates stored in
the "server_keys" directory.