Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SSE-IoT-Encryption
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Fuhrmann
SSE-IoT-Encryption
Commits
b114ee19
Commit
b114ee19
authored
6 months ago
by
Dominik Fuhrmann
Browse files
Options
Downloads
Patches
Plain Diff
bugfix
parent
41c6306b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
communicationScripts/server.py
+4
-1
4 additions, 1 deletion
communicationScripts/server.py
with
4 additions
and
1 deletion
communicationScripts/server.py
+
4
−
1
View file @
b114ee19
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment