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 isPEM. seeopenssl-format-options(1)for all the details. and forNSSoutput: 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-textoption 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 suppliedID. theIDcan 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.1orTLSv1. - 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 π
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
- ubuntu stonking: openssl 4.0.3-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms