OPENSSL-SESS_ID(1SSL)

πŸ’– NAME πŸ’–

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


✨ SYNOPSIS ✨

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

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe: this command takes the encoded version of the SSL session structure and does its lil thing with it, and if you want, it'll also print out all the SSL session deets β€” like, yes, the actual SSL session master key β€” in human readable format. iconic behavior, truly.

but listen πŸ‘‘ β€” this is a diagnostic tool. to use it properly you genuinely need some knowledge of the SSL protocol, so most users will not need to use it. it's giving "for the girlies who already know." iykyk.

also real talk: the precise format of the data can vary across OpenSSL versions and is not documented. no cap. so don't come for me if it looks different, fr fr 😭


πŸŽ€ OPTIONS πŸŽ€

  • -help β€” prints out a usage message. the little "here's how this works" moment 🫢
  • -inform DER|PEM, -outform DER|PEM|NSS β€” the input and output formats, bestie. the default is PEM. see openssl-format-options(1) for all the details. and for NSS output: the session ID and master key get reported in NSS "keylog" format. cute, right? ✨
  • -in filename β€” tells it which input filename to read session information from. no filename? it reads from standard input by default. main character energy of defaults πŸ’…
  • -out filename β€” tells it which output filename to write session information to. and if you don't specify this option at all, it goes to standard output. periodt.
  • -text β€” prints out the various public or private key components in plain text, in addition to the encoded version. like, both. you get both. 🌸
  • -cert β€” if a certificate is present in the session, it'll be output using this option. and if the -text option is also present, then it gets printed out in text form too. stacking options, we love to see it πŸ‘‘
  • -noout β€” this one prevents output of the encoded version of the session. so you just... don't get that part. simple as.
  • -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. head's up tho: this option won't normally be used. it's a niche queen πŸ™ˆ

🌈 OUTPUT 🌈

typical output, look at her:

 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)

and these are described below in more detail, bestie, don't worry 🫢

  • Protocol β€” this is the protocol in use: TLSv1.3, TLSv1.2, TLSv1.1 or TLSv1.
  • Cipher β€” the cipher used. this is the actual raw SSL or TLS cipher code, so go check the SSL or TLS specifications for more info.
  • 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. πŸ‘€
  • 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 bestie, sit down for this one. since the SSL session output contains the master key, it is possible to read the contents of an encrypted session using this information. yeah. that's a lot. 😭

so 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. no cap, do not do this in prod, i am begging πŸ™ˆ

πŸ’€ BUGS πŸ’€

the cipher and start time should be printed out in human readable form. they're not. we know. it's on the list. πŸ’…


🧚 SEE ALSO 🧚

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


Copyright 2000-2026 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 whole thing, bestie, we ate and left no crumbs πŸ’–βœ¨ this page was coming to you straight from OpenSSL 4.0.3, dated 2026-09-29 β€” slay, mwah πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from