Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想运行一个处理来自inetd 的加密通信的Ruby 脚本。由于我需要证书信息以进行进一步处理,因此我无法将 SSL“卸载”到 stunnel 之类的东西。
为此,我必须以某种方式将 STDIN 和 STDOUT 与 Ruby SSL 对象一起使用。不幸的是,OpenSSL:SSL:SSLSocket 在其构造函数中只接受一个 IO。有没有办法将 STDIN 和 STDOUT 绑定到 IO,以便它从标准输入读取并写入标准输出?
$stdin并且$stdout可以互换地用作IO对象。您可以将它们传递给 SSLSocket。这有帮助吗?否则我需要更多代码来帮助你。
$stdin
$stdout
IO