Skip to content

docs: keep public RustChain TLS verification enabled#5619

Closed
iamdinhthuan wants to merge 2 commits into
Scottcjn:mainfrom
iamdinhthuan:iamdinhthuan/docs-strict-tls-rustchain-org-5618
Closed

docs: keep public RustChain TLS verification enabled#5619
iamdinhthuan wants to merge 2 commits into
Scottcjn:mainfrom
iamdinhthuan:iamdinhthuan/docs-strict-tls-rustchain-org-5618

Conversation

@iamdinhthuan
Copy link
Copy Markdown
Contributor

Fixes #5618.

Related bounty: Scottcjn/rustchain-bounties#71
Payout/miner id if accepted: iamdinhthuan

Summary

  • replace public https://rustchain.org curl -k examples with strict-TLS curl -fsS examples
  • remove verify=False from Python requests examples for the public RustChain hostname
  • keep private/self-signed node guidance scoped to explicit CA-bundle verification
  • add a regression test that scans the public docs for future insecure public-host TLS examples

Duplicate and Safety Checks

Validation

  • python3 -B -m pytest -q tests/test_miner_checklist.py tests/test_postman_collection_validator.py tests/test_public_docs_tls_examples.py --tb=short -> 10 passed in 0.07s
  • git diff --check HEAD~1..HEAD -> passed
  • python3 tools/bcos_spdx_check.py --base-ref origin/main -> BCOS SPDX check: OK
  • rg -n "curl -[A-Za-z]*k[A-Za-z]*.*https://rustchain\\.org|verify=False" README.md docs/API.md docs/README.md docs/zh-CN/README.md -> no matches
  • curl -fsS --max-time 15 -o /tmp/rustchain-health.json -w '%{http_code}\n' https://rustchain.org/health -> 200
  • curl -fsS --max-time 15 -o /tmp/rustchain-miners.json -w '%{http_code}\n' https://rustchain.org/api/miners -> 200
  • curl -fsS --max-time 15 -o /tmp/rustchain-balance.json -w '%{http_code}\n' 'https://rustchain.org/wallet/balance?miner_id=iamdinhthuan' -> 200

@github-actions github-actions Bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) tests Test suite changes size/S PR: 11-50 lines labels May 18, 2026
@iamdinhthuan
Copy link
Copy Markdown
Contributor Author

CI note after opening: the test job fails during full-suite collection before running the docs regression because the runner is missing baseline dependencies:

ModuleNotFoundError: No module named 'aiohttp'
ModuleNotFoundError: No module named 'flask_cors'
ModuleNotFoundError: No module named 'matplotlib'

This PR only changes docs plus tests/test_public_docs_tls_examples.py. The focused validation from the PR body still passes locally:

python3 -B -m pytest -q tests/test_miner_checklist.py tests/test_postman_collection_validator.py tests/test_public_docs_tls_examples.py --tb=short
10 passed in 0.07s

I am not bundling dependency packaging changes into this docs fix because that is a separate baseline CI issue.

@github-actions github-actions Bot added BCOS-L2 Beacon Certified Open Source tier BCOS-L2 (required for non-doc PRs) consensus Consensus/RIP-200 related wallet Wallet/transfer related api API endpoint related size/M PR: 51-200 lines and removed size/S PR: 11-50 lines labels May 18, 2026
Copy link
Copy Markdown

@TJCurnutte TJCurnutte left a comment

Choose a reason for hiding this comment

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

Approved. This fixes the security-relevant docs drift from #5618: public https://rustchain.org examples no longer teach users to disable certificate verification, while the private/self-signed-node guidance is scoped to an explicit CA bundle instead of verify=False.

Validation run locally on head b25852b8e1dbdddbedc726b517063a9f76c3f727:

  • git diff --check origin/main...HEAD passed.
  • python3 -B -m py_compile tests/test_public_docs_tls_examples.py passed.
  • python3 -B -m pytest -q tests/test_miner_checklist.py tests/test_postman_collection_validator.py tests/test_public_docs_tls_examples.py --tb=short passed with 11 passed in 0.48s.
  • python3 tools/bcos_spdx_check.py --base-ref origin/main returned BCOS SPDX check: OK.
  • Custom scan across the 49 changed files found 311 insecure public-host TLS examples on origin/main and 0 after this PR. The scan covered curl ... -k / --insecure against https://rustchain.org, Python requests.*(... verify=False ...) blocks for https://rustchain.org, and public-host self-signed/verify=False labeling.
  • Live strict-TLS probes with curl -fsS --max-time 20 returned HTTP 200 for https://rustchain.org/health, https://rustchain.org/api/miners, and https://rustchain.org/wallet/balance?miner_id=iamdinhthuan.

The broad docs sweep is justified here because the regression test now prevents the specific public-host TLS anti-pattern from reappearing across Markdown/HTML docs. I did not see runtime auth, transfer, withdrawal, or payout code paths changed in this PR.

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@jaxint jaxint left a comment

Choose a reason for hiding this comment

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

LGTM! Great work on this PR. 🚀

@Auren-Innovation
Copy link
Copy Markdown

Code Review: PR #5619

Title: docs: keep public RustChain TLS verification enabled
Review Type: Documentation
Recommended Reward: 5-8 RTC


Summary

Documentation update emphasizing TLS verification best practices.

Critical

None.

Warning

None.

Suggestion

  • Consider adding brief rationale for why TLS verification should remain enabled
  • Could include troubleshooting tips for common TLS issues

Verdict

Approve - Documentation improvement promotes security best practices.


Review by Herr Amano | 2026-05-18

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Auren-Innovation
Copy link
Copy Markdown

💰 Wallet Address for Bounty Rewards

miner_id:

Verification:
{"amount_i64":0,"amount_rtc":0.0,"miner_id":"herr-amano"}

Please transfer rewards to this address.


Wallet address added by Herr Amano

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Scottcjn
Copy link
Copy Markdown
Owner

Closing as stale branch — would cause destructive deletions if merged.

Your branch was filed roughly 155 commits behind current main. Since then, many overlapping fixes from other contributors have landed via parallel PRs. GitHub's mergeable=clean indicator only catches text-level conflicts — it doesn't detect "this branch is so old that merging would silently delete code that landed after it was filed."

Bounty credit acknowledged

If your fix addressed a real bug, the canonical version has very likely already shipped via a parallel contributor's PR over the past two weeks. Specific cases covered by today's audit:

If you want fresh review

Rebase against current main and verify your diff shows roughly the size of the changes you originally made:

git fetch upstream main
git rebase upstream/main
git diff main..HEAD --shortstat

If the deletion count is significantly higher than what you added, the branch is still picking up stale assumptions — recreate from a fresh main.

Thanks for the contribution work this week.

@Scottcjn Scottcjn closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api API endpoint related BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) BCOS-L2 Beacon Certified Open Source tier BCOS-L2 (required for non-doc PRs) consensus Consensus/RIP-200 related documentation Improvements or additions to documentation size/M PR: 51-200 lines tests Test suite changes wallet Wallet/transfer related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SECURITY] Docs tell users to disable TLS verification for rustchain.org

6 participants