Skip to content
Snippets Groups Projects
Commit b114ee19 authored by Dominik Fuhrmann's avatar Dominik Fuhrmann
Browse files

bugfix

parent 41c6306b
No related branches found
No related tags found
No related merge requests found
...@@ -12,10 +12,12 @@ def run_server(): ...@@ -12,10 +12,12 @@ def run_server():
cipher_suite = "TLS_AES_128_GCM_SHA256" # Sichere Cipher Suite cipher_suite = "TLS_AES_128_GCM_SHA256" # Sichere Cipher Suite
context = wolfssl.SSLContext(wolfssl.PROTOCOL_TLSv1_3) # TLS 1.3 verwenden context = wolfssl.SSLContext(wolfssl.PROTOCOL_TLSv1_3) # TLS 1.3 verwenden
context.load_cert_chain(certfile=cert_file, keyfile=key_file) context.load_cert_chain(certfile=cert_file, keyfile=key_file)
context.load_verify_locations(ca_cert) context.load_verify_locations(ca_cert) # Zertifikate des CA hinzufügen
context.set_ciphers(cipher_suite) context.set_ciphers(cipher_suite)
# Setze den Debug-Modus auf true
context.set_verify(wolfssl.VERIFY_PEER) # Überprüfen des Clientzertifikats context.set_verify(wolfssl.VERIFY_PEER) # Überprüfen des Clientzertifikats
context.set_mode(wolfssl.SSL_MODE_ENABLE_PARTIAL_WRITE) # Erlaubt teilweise Schreiboperationen
# Server-Socket erstellen # Server-Socket erstellen
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
...@@ -29,6 +31,7 @@ def run_server(): ...@@ -29,6 +31,7 @@ def run_server():
try: try:
ssl_sock = context.wrap_socket(client_sock, server_side=True) ssl_sock = context.wrap_socket(client_sock, server_side=True)
print("SSL Handshake erfolgreich!")
# Datei empfangen # Datei empfangen
with open("received_file.txt", "wb") as f: with open("received_file.txt", "wb") as f:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment