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
MODBUS/TCP Security support (TLS) #133
Comments
Thanks for the proposal. This is a community project and contributions are always welcome. Don't hesitate to open a Draft PR for early discussion. |
Hi uklotzde, I'm new to the rust development, but I succeeded in implement a simple tls server using some crates from the tokio modbus project. However i do not complete understand how to integrate this tls server to the project code in order to do a pull request. I will post the code here to contribute with the project. I have tested the server with a client written with C and libmodbus. It's working. main.rs: mod slave; use crate::frame::{Response, ResponsePdu, ExceptionResponse, Request}; /// Tokio Rustls server example
} fn load_certs(path: &Path) -> io::Result<Vec> { fn load_keys(path: &Path) -> io::Result<Vec> { #[tokio::main]
} cargo.toml: See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html[dependencies] |
As I understand it, this code can help with the development of a TLS server for the project, as it demonstrates how to create a TLS connection, accept new connections, and receive and send packets over TLS. Basically is the same of tcp server, to read a new modbus frame is just to execute this line with the TLS connection: |
The client-side support for TLS still needs to be resolved. I missed that aspect. To keep thinks manageable I created a new, focused issue #161 and added a back link to this issue. |
I noticed that we still need to abstract over both As a prerequisite #119 needs to be implemented first. |
The addition of both TLS client and server examples demonstrate that TLS support could be added as an additional layer on top of the foundational Modbus code. A fully configurable, batteries included approach enabled by a Cargo feature would be handy. But as long as no one is able to provide a solid and flexible implementation that is suitable for covering (almost) all practical use cases we should close this issue. |
Hi. Congrats for the project.
Is it possible to add support for the new specification, the Modbus TCP Security, based on TLS?
Some of new protocols based on modbus are migrating for this modbus version, as the sunspec modbus protocol. The specification is available at:
https://modbus.org/docs/MB-TCP-Security-v21_2018-07-24.pdf
I beleive it can be implemented based on tokio-rustls.
Thanks in advance.
Gustavo Denardin
The text was updated successfully, but these errors were encountered: