Commit fe10431
committed
feat(server): add run_connection_pre_authenticated for transport-encrypted streams
Adds a sibling to RdpServer::run_connection that walks the same
per-connection state machine but skips the IronRDP-managed TLS handshake.
The caller's stream must already be transport-encrypted at a lower layer
(typically a WebSocket Secure terminator in an RDCleanPath-shaped
deployment).
The implementation mirrors run_connection except for one step: on
BeginResult::ShouldUpgrade, instead of calling tls_acceptor.accept(stream),
the new method calls Acceptor::mark_security_upgrade_as_done() to advance
the state machine and re-wraps the inner stream as already-post-TLS. The
Hybrid CredSSP block, accept_finalize, and shutdown sequence are
identical to run_connection because CredSSP carries its own crypto via
TSRequest and does not require the underlying transport's TLS.
Builds on PR #1181 which made run_connection generic over any
AsyncRead+AsyncWrite stream. This method extends the same design intent
to streams that have been TLS-terminated by a lower layer.
Wire-level invariant preserved: the X.224 negotiation is untouched. The
acceptor still advertises whatever SecurityProtocol it was constructed
with; only the TLS-handshake step is skipped. Earlier attempts at a
wire-level signal (PR #1210, RdpServerSecurity::PreSecured) failed
interop with vanilla clients and were closed; this method sidesteps
that approach by relying on a higher-layer protocol (RDCleanPath) to
inform the client that TLS happened elsewhere.
Considered and rejected: a new RdpServerSecurity::PreAuthenticated
variant. The canonical deployment serves both vanilla TCP+TLS clients
and WSS+RDCleanPath clients from a single server instance on different
listeners; per-connection choice fits that use case, while a variant
would force splitting into two server instances and break exhaustive
matches downstream. Sibling method has zero API breakage.
A NOTE comment in the source records the synchronization requirement
with run_connection's ShouldUpgrade arm so future rebases catch
upstream divergence.
The motivating downstream consumer is lamco-rdp-server's WebSocket plus
RDCleanPath listener, which retires its external ws-rdp-proxy from the
production WASM-client path.1 parent 45ec1ef commit fe10431
1 file changed
Lines changed: 124 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
772 | 896 | | |
773 | 897 | | |
774 | 898 | | |
| |||
0 commit comments