From scrapy/scrapy#4368
This is done by LD_PRELOAD hooking openssl.
sudo apt install libssl-dev
sudo apt install git make gcc
cd wireshark-notes/src
make
This will build libsslkeylog.so
export LD_PRELOAD=/path/to/libsslkeylog.so
export SSLKEYLOGFILE=/path/to/SSLKEYLOGFILE
./sslkeylog.sh curl https://example.com -sI
You should observe /path/to/SSLKEYLOGFILE being populated. Load the log file in wireshark to decrypt TLS traffic