Open utterances-bot opened 2 years ago
关于 socat - openssl-connect:192.168.31.123:4433,cafile=server.crt 这条命令,最后的cafile参数应该设置成ca.crt,即ca的证书而不是server的证书,毕竟使用ca的证书来验证server的证书嘛,在我本机的测试确实是这样的。
另外感谢作者这篇文章对我的帮助。
@Nillouise 感谢反馈:heart:,文章已更新
很有用!
担当临时的 web 服务器
curl 请求会报错的, 因为没有http返回头。
silas@silas-ThinkPad-L460:~/tmp$ curl http://localhost:8484 curl: (1) Received HTTP/0.9 when not allowed
silas@silas-ThinkPad-L460:~/tmp$ curl localhost:8484 curl: (1) Received HTTP/0.9 when not allowed
silas@silas-ThinkPad-L460:~/tmp$ telnet localhost 8484 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. hello world Connection closed by foreign host. silas@silas-ThinkPad-L460:~/tmp$ nc localhost 8484 hello world
@shinvdu 哦确实是,我之前测试时没到位,把 py 脚本改为如下内容即可,我更新下文章:
print("""HTTP/1.1 200 OK
Content-Type: text/plain
hello world
""")
Linux 网络工具中的瑞士军刀 - socat & netcat - This Cute World
https://thiscute.world/posts/socat-netcat/