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

sc connect example using ssl context to secure the connection with tls #60

Open
reider-dev opened this issue Oct 4, 2024 · 2 comments

Comments

@reider-dev
Copy link

Would it be possible to adapt the link-layer sc echo server and client examples to include an ssl context such that mutual authentication is enforced?

I have both examples running in independent docker containers and can see the echo functioning well. However, all my attempts to simply adapt the examples (and/or the bacpypes3.sc.service file) have failed to show the same functionality when trying to connect to device with wss://uri.

Any feedback/thoughts would be greatly appreciated. My feeling is that it should be trivial, and I am missing something simple.

Another question: Is it expected that the above mentioned echo server doesn't work in anything greater than python 3.10? I tried bumping the version in the (my) Dockerfiles, but then the basic echo functionality stopped working.

@JoelBender
Copy link
Owner

There is a new API for the websockets library, thank you for the issue. Apparently you can pass additional arguments on the server side that get passed to create_server(), similarly the client side there is create_connection(). There are some interesting tidbits here for mutual authentication. I can fix the API piece, but getting the tooling correct for generating certificates is still a mountain I haven't climbed (cliff maybe? every time I start it looks more like a wall).

@reider-dev
Copy link
Author

Thanks for the response and information. If the API piece is working, I image the tooling to generate certificates is anyway out of scope. Most use cases would expect the user to bring their own. At the moment I am trying to simulate one or more trivial BACnet enabled devices, as docker containers, securely connecting to a BACnet hub (a separate docker container). For the moment I simply generated my own authority and signed certificates with openssl. Thanks again!

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

No branches or pull requests

2 participants