OPENSSL-SESS_ID(1ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… openssl-sess_id β€” the SSL/TLS session handling command πŸ’…

okay so this is openssl-sess_id from the OpenSSL manual (section 1ossl), and bestie, it's a whole vibe. it looks at a serialized/encoded SSL session structure and can spill the tea on session details (yes, including the master key πŸ‘€) in human-readable form. it's a diagnostic tool though, so it fr fr needs some SSL protocol knowledge to drive properly β€” most users will not need to use it. not me being the exception, obviously. πŸ’β€β™€οΈ


✨ NAME ✨

openssl-sess_id β€” the SSL/TLS session handling command πŸŽ€

🌸 SYNOPSIS 🌸

openssl sess_id [-help] [-inform DER|PEM] [-outform DER|PEM|NSS] [-in
filename] [-out filename] [-text] [-cert] [-noout] [-context ID]

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically this command processes the encoded version of the SSL session structure, and it can optionally print out SSL session details β€” like, for example, the SSL session master key πŸ”‘ β€” in human readable format. since it's a diagnostic tool that needs some knowledge of the SSL protocol to use properly, most users will not need to use it. iykyk.

the precise format of the data can vary across OpenSSL versions and is not documented. so like... don't come for me if it looks different in your version, okay? 😭

✨ OPTIONS ✨

  • -help β€” prints out a usage message. the classic "what do i even do" button 🫢
  • -inform DER|PEM, -outform DER|PEM|NSS β€” the input and output formats; the default is PEM. see openssl-format-options(1) for the full details, bestie. for NSS output, the session ID and master key are reported in NSS "keylog" format. πŸ”₯
  • -in filename β€” this specifies the input filename to read session information from, or standard input by default.
  • -out filename β€” this specifies the output filename to write session information to, or standard output if this option is not specified.
  • -text β€” prints out the various public or private key components in plain text in addition to the encoded version. icon behavior.
  • -cert β€” if a certificate is present in the session, it will be output using this option. and if the -text option is also present, then it will be printed out in text form ✨
  • -noout β€” this option prevents output of the encoded version of the session. sometimes less is more πŸ’…
  • -context ID β€” this option can set the session id so the output session information uses the supplied ID. the ID can be any string of characters. this option won't normally be used. lowkey a niche one.

πŸ‘‘ OUTPUT πŸ‘‘

typical output looks like this, and yes it's giving main character diagnostics:

 SSL-Session:
     Protocol  : TLSv1
     Cipher    : 0016
     Session-ID: 871E62626C554CE95488823752CBD5F3673A3EF3DCE9C67BD916C809914B40ED
     Session-ID-ctx: 01000000
     Master-Key: A7CEFC571974BE02CAC305269DC59F76EA9F0B180CB6642697A68251F2D2BB57E51DBBB4C7885573192AE9AEE220FACD
     Key-Arg   : None
     Start Time: 948459261
     Timeout   : 300 (sec)
     Verify return code 0 (ok)

these are described below in more detail ⬇️

🧚 Protocol

this is the protocol in use: TLSv1.3, TLSv1.2, TLSv1.1, TLSv1 or SSLv3.

🧚 Cipher

the cipher used β€” this is the actual raw SSL or TLS cipher code. see the SSL or TLS specifications for more information, because that's a whole other rabbit hole πŸ‡

🧚 Session-ID

the SSL session ID in hex format.

🧚 Session-ID-ctx

the session ID context in hex format.

🧚 Master-Key

this is the SSL session master key. πŸ”‘ (yes, the big one. be careful with it, more on that below.)

🧚 Start Time

this is the session start time represented as an integer in standard Unix format.

🧚 Timeout

the timeout in seconds.

🧚 Verify return code

this is the return code when an SSL client certificate is verified.

🌈 NOTES 🌈

okay so real talk, this is the important part:

since the SSL session output contains the master key, it is possible to read the contents of an encrypted session using this information. therefore, appropriate security precautions should be taken if the information is being output by a "real" application. this is however strongly discouraged and should only be used for debugging purposes.

like... do NOT leave this lying around in prod, bestie. 🚨 debugging only. periodt.

πŸ’€ BUGS πŸ’€

the cipher and start time should be printed out in human readable form. yeah. that's the whole bug. it's giving "we know, we know" πŸ™ˆ

🫢 SEE ALSO 🫢

openssl(1), openssl-ciphers(1), openssl-s_server(1)

Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the page, bestie!! πŸŽ€βœ¨ version 3.5.0, dated 2026-09-25 β€” signed, sealed, delivered by the OpenSSL girlies. slay πŸ’…πŸ’–

πŸ“¦ where this page comes from