Skip to content

feat(commands): implement RFC 7151 (File Transfer Protocol HOST Command for Virtual Hosts) - #169

Draft
lezsakdomi wants to merge 2 commits into
QuorumDMS:mainfrom
lezsakdomi:master
Draft

feat(commands): implement RFC 7151 (File Transfer Protocol HOST Command for Virtual Hosts)#169
lezsakdomi wants to merge 2 commits into
QuorumDMS:mainfrom
lezsakdomi:master

Conversation

@lezsakdomi

Copy link
Copy Markdown

Fix #114

Todo:

  • Add handler for command
  • Add listener
  • Provide option for checking hostname just at login time
  • Checking for hostname (domain name / ip literal) syntax according to section 3.1, including port number persistence
  • Checking if IP address matches server IP (in case supplied) (section 3.1)
  • When TLS used, checking if supplied hostname matches with one from TLS (section 3.2.2)
  • CLI options (specifying a map between virtualhosts and user/pass/root combos)
  • Tests

This commits lets you pass an `anonymous` argument at `virtualhost` event accept
@lezsakdomi

Copy link
Copy Markdown
Author

[BUG] It looks like passing motd and/or anonymous has no effect :(

@trs

trs commented Aug 8, 2019

Copy link
Copy Markdown
Contributor

Thanks for the start of this PR! I'll take a look into giving you a hand with it when I get a chance. I'll read up on the HOST command first.

@lezsakdomi

lezsakdomi commented Aug 8, 2019

Copy link
Copy Markdown
Author

RFC 7151 TL;DR:

The parameter of a HOST command is the hostname as the server was accessed, obviously.
The hostname SHOULD NOT contain a port.
If it's an IPv6, the hostname SHOULD be encapsulated in []s. If an IPv4, it MAY be enclosed between brackets or provided in the IPv6 form.

According to the specs, the server should:

  • Validate the syntax (I was afraid to implement this, because validating IPv6 addresses is hard)
  • Validate hostname validity if possible
    • If it's a bare IP (the IP should be our public IP)
    • If TLS used and hostname was in certificate

@lezsakdomi

Copy link
Copy Markdown
Author

I think this project shouldn't be so strict about validation. If ever implemented, maybe it's a good idea to provide an option to turn validation off.

Okay, syntax check could come any time :)

@lezsakdomi

Copy link
Copy Markdown
Author

Oh, and I was able to test my program using WinSCP - the only client implementing HOST I found so far

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.

2 participants