使用openssl s_server作为反向代理

是否有可能通过将握手后的所有数据转发到不同的端口来使用openssl s_server作为一种反向代理

更具体地说,我想创build一个简单的tftp-over-dtls设置用于testing目的。

不它不是。

由于openssl s_server只能执行TCP,正如man s_server的输出中man s_server

 DESCRIPTION The s_server command implements a generic SSL/TLS server which listens for connections on a given port using SSL/TLS. OPTIONS -accept port the TCP port to listen on for connections. If not specified 4433 is used. 

TFTP使用UDP(请参阅https://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol,http://www.faqs.org/rfcs/rfc1350.html ),所以我不知道如何做这个工作。

然而,nginx可能能够做你正在寻找的东西。

根据/ etc / services,存在针对TFTPS的IANA分配,但是我找不到RFC或其他相关文档。

编辑

正如在注释中指出的 – s_server(在一些openSSL版本中,例如1.1.0)支持DTLS: https ://www.openssl.org/docs/man1.1.0/apps/s_server.html。

尽pipe对于所有的openSSL版本来说都不是这样 – 1.0.2( https://www.openssl.org/docs/man1.0.2/apps/s_server.html )和1.0.1( https://www.openssl。 org / docs / man1.0.1 / apps / s_server.html )不支持DTLS。