Add TLS/TCP and DTLS/UDP support for both server and client#70
Open
ordinary-hacker wants to merge 3 commits intorobiot:masterfrom
Open
Add TLS/TCP and DTLS/UDP support for both server and client#70ordinary-hacker wants to merge 3 commits intorobiot:masterfrom
ordinary-hacker wants to merge 3 commits intorobiot:masterfrom
Conversation
Author
|
Rn I mostly just need to actually test this and do some code refinements |
Author
|
Now this is ready to merge! In case needed for vetting here's a little guide to test: first TLS works with DER format, meanwhile DTLS with PKCS#12 format, you can generate some quick test files with: openssl genrsa -out server-key.pem 2048 && \
openssl req -new -x509 -key server-key.pem -out server-cert.pem -days 365 -subj "/CN=localhost" && \
openssl x509 -in server-cert.pem -outform DER -out server-cert-new.der && \
openssl rsa -in server-key.pem -outform DER -out server-key-new.der && \
openssl pkcs12 -export -in server-cert.pem -inkey server-key.pem -out server-new.p12 -name "rustcat-server" -passout pass:then for example if using rcat listener and client for TLS # Terminal 1 (TLS Listener)
./target/debug/rcat listen -i --protocol tls --cert server-cert-new.der --key server-key-new.der 8443
# Terminal 2 (rcat TLS Client)
./target/debug/rcat connect -s bash --protocol tls localhost 8443rcat TLS listener but with openssl client # Terminal 1 (TLS Listener)
./target/debug/rcat listen -i --protocol tls --cert server-cert-new.der --key server-key-new.der 8443
# Terminal 2 (OpenSSL Client)
openssl s_client -connect localhost:8443 -verify_return_errorrcat for DTLS listener and client # Terminal 1 (DTLS Listener)
./target/debug/rcat listen -i --protocol dtls --cert server-new.p12 8444
# Terminal 2 (rcat DTLS Client)
./target/debug/rcat connect -s bash --protocol dtls --cert server-new.p12 localhost 8444if just doing some echo tests for TLS: # Terminal 1
./target/debug/rcat listen -i --protocol tls --cert server-cert-new.der --key server-key-new.der 8443
# Terminal 2
echo "Hello TLS" | openssl s_client -connect localhost:8443 -quietfor dtls: # Terminal 1
./target/debug/rcat listen -i --protocol dtls --cert server-new.p12 8444
# Terminal 2
./target/debug/rcat connect -s cat --protocol dtls --cert server-new.p12 localhost 8444 |
Owner
|
looks cool |
Author
|
@robiot thanks :D could you do the merge??? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Still just a draft, right now the code compiles and it already has some stuff tied up for it to support these two encryption methods. This draft PR is mostly to keep a little bit on progress and also if anyone has any suggestions and stuff like that.
I'll keep adding more commits to this as I test stuff, change stuff, and so on.
Fixes #59