Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bond-cli: implement https support to bond-cli, added security levels for https-insecure and https #67

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

AliakseiSubach
Copy link
Collaborator

implement https support to bond-cli, added security levels for https-insecure and https

print(f"Handler assigned: {handler}")

if protocol in ["https", "https-insecure"]:
# Need to add certificate with name cert.pem and key with name key.pem for
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AliakseiSubach will you add these files to the project?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrismerck i can push my files. But its self-signed certificate. Everyone can create it using cmd: "openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes". Do you need this for testing?

key_path = os.path.join(base_dir, "key.pem")

context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
if protocol == "https-insecure":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference here? Is it even possible for the server-side of a TLS connection to verify the client in this way? And even if so, I do not see how it would work with a Bond on the local network. Please just support the http/https.

Copy link
Collaborator Author

@AliakseiSubach AliakseiSubach Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrismerck This context will be used to handle encrypted communications between server and client. And server side must have key and cert for session key creation. After this, they switch to a secure channel, where data transmission occurs using a symmetric encryption algorithm.

from http.server import HTTPServer, SimpleHTTPRequestHandler
from pathlib import Path
from queue import Queue
from threading import Thread

import requests.exceptions
#import requests.exceptions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this? It is used by line 248.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants