Skip to content

Conversation

@qlrd
Copy link
Contributor

@qlrd qlrd commented Mar 21, 2025

What is the purpose of this pull request?

Fix #421

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other:

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other: .

Description

Added functional tests for SSL/TLS, and some other stuffs that enabled these tests:

  • pyproject.toml/uv.lock: added cryptography lib to enable the creation of private keys and self-signed certificates;

  • created tests/test_framework/crypto/pkcs8.py: this module generate well formatted pkcs8 private keys and self-signed certificates for our SSL-enable florestad node on regtest network;

  • tests/florestad/ssl-test.py: test the creation of a SSL-enabled florestad node, a electrum client that try to connect to port 50002 and request a ping, asserting a successfully connection;

  • tests/florestad/ssl-fail-test.py: test the creation of a SSL-disabled florestad node, a electrum client that try to connect to port 50002, asserting a failure on connection.

Notes to the reviewers

When running tests/florestad/ssl-test.py, it's worth to check it's log, since an strange error (in the last line) occured after request a ping to SSL-enabled node:

[2025-03-21 17:06:43 WARN florestad::florestad] Could not read config file, ignoring it
[2025-03-21 17:06:43 INFO florestad::florestad] Wallet setup completed!
[2025-03-21 17:06:43 INFO florestad::florestad] Loading blockchain database
[2025-03-21 17:06:43 INFO florestad::florestad] Loaded compact filters store at height: 0
[2025-03-21 17:06:43 INFO florestad::florestad] Starting server
[2025-03-21 17:06:43 INFO florestad::florestad] TLS server running on: 0.0.0.0:50002
[2025-03-21 17:06:43 INFO florestad::florestad] Server running on: 0.0.0.0:50001
[2025-03-21 17:06:43 INFO floresta_wire::p2p_wire::address_man] Starting peer discovery via DNS seeds
[2025-03-21 17:06:43 INFO floresta_wire::p2p_wire::address_man] Got 0 peers from 0 DNS seeds
[2025-03-21 17:06:43 ERROR floresta_wire::p2p_wire::running_node] 334:crates/floresta-wire/src/p2p_wire/running_node.rs - Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })
[2025-03-21 17:06:43 INFO floresta_wire::p2p_wire::chain_selector] Starting ibd, selecting the best chain
[2025-03-21 17:06:44 INFO floresta_electrum::electrum_protocol] New client connection
[2025-03-21 17:06:44 ERROR floresta_electrum::electrum_protocol] TLS accept error: Custom { kind: InvalidData, error: CorruptMessage }

Checklist

  • I've signed all my commits
  • I ran just lint
  • I ran cargo test
  • I've checked the integration tests
  • I've followed the contribution guidelines
  • I'm linking the issue being fixed by this PR (if any)

@qlrd qlrd force-pushed the test-functional-florestad-ssl branch 2 times, most recently from 60d212a to 81bb086 Compare March 21, 2025 20:54
Copy link
Member

@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

Very nice! Just some minor nits and we should be good

fix vinteumorg#421

* pyproject.toml/uv.lock: added cryptography lib to enable the creation
of private keys and self-signed certificates;

* created tests/test_framework/crypto/pkcs8.py: this module generate
well formatted pkcs8 private keys and self-signed certificates for our
SSL-enable florestad node on regtest network;

* tests/florestad/ssl-test.py: test the creation of a SSL-enabled
florestad node, a electrum client that try to connect to port 50002 and
request a ping, asserting a successfully connection;

* tests/florestad/ssl-fail-test.py: test the creation of a SSL-disabled
florestad node, a electrum client that try to connect to port 50002,
asserting a failure on connection.
@qlrd qlrd force-pushed the test-functional-florestad-ssl branch from 81bb086 to 5a0d551 Compare March 24, 2025 11:00
@qlrd qlrd requested a review from Davidson-Souza March 24, 2025 11:31
Copy link
Member

@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

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

ACK 5a0d551

@Davidson-Souza Davidson-Souza merged commit b2a6171 into vinteumorg:master Mar 24, 2025
8 checks passed
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

Successfully merging this pull request may close these issues.

[Enhancement] Add functional tests for SSL electrum integration.

2 participants