openssl/openssl

s_client/s_server: Read PSK from file instead of taking it as CLI parameter

Open

#24,721 建立於 2024年6月24日

在 GitHub 查看
 (4 留言) (0 反應) (1 負責人)C (11,262 fork)batch import
branch: masterhelp wantedtriaged: feature

倉庫指標

Star
 (30,157 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I want to use OpenSSL s_client and s_server to test PSK ciphersuites. Currently, it seems like the PSK can only be provided as an explicit parameter, as seen in the following minimal example commands:

$ openssl s_client -connect localhost:4433 -psk "1a2b3c4d"
$ openssl s_server -nocert -accept localhost:4433 -www -psk "1a2b3c4d" -tls1_2

For security reasons, it would be great if the PSK could be read from a file. As it is right now, the PSK is showing up in clear text in the process list:

$ ps aux | grep openssl
username     526931  0.1  0.0  10708  8192 pts/6    S+   16:42   0:00 openssl s_server -nocert -accept localhost:4433 -www -psk 1a2b3c4d -tls1_2

Tested with OpenSSL 3.0.10 on Ubuntu 23.10.

貢獻者指南