PEM_READ_SSL_SESSION(3)
β¨ PEM_READ_SSL_SESSION β¨
okay so bestie, this is a page out of the libssl / libcrypto library manual β the <openssl/ssl.h>-girlies know π
. It's all about the four functions that encode and decode SSL_SESSION objects into PEM format. Saving and loading your session, but make it PEM. π
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
SSL_SESSION *
PEM_read_SSL_SESSION(FILE *fp, SSL_SESSION **a, pem_password_cb *cb,
void *u);
SSL_SESSION *
PEM_read_bio_SSL_SESSION(BIO *bp, SSL_SESSION **a, pem_password_cb *cb,
void *u);
int
PEM_write_SSL_SESSION(FILE *fp, const SSL_SESSION *a);
int
PEM_write_bio_SSL_SESSION(BIO *bp, const SSL_SESSION *a);
π¦ DESCRIPTION π¦
So these routines are literally the glow-up translators between your local, in-memory instances of ASN.1 SSL_SESSION objects and the PEM encoding. In β out, out β in, no cap. β¨
PEM_read_SSL_SESSION()β reads a PEM-encodedSSL_SESSIONobject from the filefpand returns it. Thecbanduparameters are exactly as described inPEM_read_bio_PrivateKey(3)β same energy, no originality, and that's fine. πPEM_read_bio_SSL_SESSION()β basicallyPEM_read_SSL_SESSION()'s sibling, except it reads from theBIObp. Same function, different source, we stan a flexible queen. πPEM_write_SSL_SESSION()β writes the PEM encoding of the objectato the filefp. Out it goes, slay. πPEM_write_bio_SSL_SESSION()β similarly, but it writes to theBIObp. Iconic parallel structure, honestly. πΈ
π RETURN VALUES π
PEM_read_SSL_SESSION()andPEM_read_bio_SSL_SESSION()give you back a pointer to an allocated object β which you must release by callingSSL_SESSION_free(3), bestie, don't ghost it β orNULLon error. πPEM_write_SSL_SESSION()andPEM_write_bio_SSL_SESSION()return the number of bytes written, or0on error. That's the whole return value, periodt.
fr fr: don't forget the SSL_SESSION_free(3) call. Memory leaks are not main character energy. π«Ά
π SEE ALSO π
β HISTORY β
PEM_read_SSL_SESSION()andPEM_write_SSL_SESSION()first appeared in SSLeay 0.5.2. OG behavior. π₯PEM_read_bio_SSL_SESSION()andPEM_write_bio_SSL_SESSION()first appeared in SSLeay 0.6.0 β the sequel, arguably better. π- All of these functions have been available since OpenBSD 2.4. Longevity icon. π
and that's the whole page, bestie π§ β shipped from Debian on June 8, 2025, so you know it's fresh. bye, love you, free your sessions ππ
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2016 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms