OPENSSL-REHASH(1SSL)
β¨ NAME β¨
openssl-rehash, c_rehash β the lil tools that make symbolic links to files named by their hash values π
okay so quick thing before we dive in: this whole page is from OPENSSL-REHASH(1SSL), bestie. that's the manual section we're living in. stay with me π
πΈ SYNOPSIS πΈ
openssl rehash [-h] [-help] [-old] [-compat] [-n] [-v] [-provider name]
[-provider-path path] [-provparam [name:]key=value] [-propquery propq]
[directory] ...
like. look at her. a whole command with a whole pile of flags and then just... directories. as many as u want. iconic.
π¦ DESCRIPTION π¦
okay so here's the tea, fr fr π
openssl rehash goes through directories and calculates a hash value for every single .pem, .crt, .cer, or .crl file in the directory list u gave it, and then it makes symbolic links for each file β where the name of the link is that hash value. chef's kiss. π
If ur platform doesn't support symbolic links, it just makes a copy instead. no drama.
and why do we even care??? because SO many programs that use OpenSSL literally require directories to be set up like this in order to FIND certificates. it's giving "the bouncer needs ur name on the list, bestie". π
so here's how the dirs get picked:
- if u name directories on the command line, those get processed one after another, in turn. β
- if u don't name any, then the
SSL_CERT_DIRenvironment variable gets consulted. it should be a colon-separated list of directories (or semicolon-separated on Windows, iykyk), just like thePATHvariable. π« - and if that's not set either? then the default directory gets processed β it's installation-specific, but often it's
/usr/local/ssl/certs. π
one thing tho. for a directory to actually get processed, u gotta have write permissions on that directory. no write perms = an error gets generated. lowkey harsh but fair. π
the link names, let's talk about them π€
the links that get created look like this:
HHHHHHHH.D
where every single H is a hexadecimal character, and D is a single decimal digit. cute, organized, obsessed. π
important warning tho β when a directory gets processed, ALL links in it that have a name in that syntax get removed FIRST. even if they're being used for some totally other purpose. like... it does not care. it will simply delete them. π so if u wanna skip that removal step, use the -n flag. (more on her in a sec.)
hashes for CRL's look super similar, except the letter r shows up after the period, like this:
HHHHHHHH.rD
multiple objects can have the SAME hash, and when that happens they get indicated by incrementing that D value. how are duplicates found? by comparing the full SHA-1 fingerprint. and if a duplicate is found, a warning gets displayed. π¨
a warning ALSO gets displayed if there are files that can't be parsed as either a certificate or a CRL, or if more than one such object appears in the file. main character problems honestly. π
π OPTIONS π
-help,-hβ displays a brief usage message. the "hi what is this" button. π«Ά-oldβ uses old-style hashing (MD5, as opposed to SHA-1) for generating links, the kind that were used for releases before1.0.0. but heads up bestie: current versions will NOT use the old style. π΅-nβ does not remove existing links. this is literally needed when u wanna keep new and old-style links chillin' in the same directory. π-compatβ generates links for BOTH old-style (MD5) AND new-style (SHA1) hashing. this lets releases before1.0.0use these links along-side newer releases. everybody eats. π₯-vβ prints messages about old links removed and new links created. by default, this command only lists each directory as it gets processed. so-vis the yapper mode. π£οΈβ¨-provider name,-provider-path path,-provparam [name:]key=value,-propquery propqβ these ones? go read"Provider Options"inopenssl(1),provider(7), andproperty(7). they're the provider girlies. π
π ENVIRONMENT π
OPENSSLβ the path to an executable to use to generate hashes and fingerprints (see above). βPATHβ list of paths, separated by colons (or semicolons, on Windows platforms), where theopensslexecutable is searched in case the path to the hash generating executable is not provided in theOPENSSLenvironment variable, or it is not usable β that is, it does not exist or is not executable. the backup plan of backup plans. πͺSSL_CERT_DIRβ list of directories to operate on. on Unix-like systems the list entries are separated by a colon. on Windows they are separated by a semicolon. Ignored if directories are listed on the command line. periodt. π
π SEE ALSO π
openssl(1), openssl-crl(1), openssl-x509(1)
go read ur friends, bestie. they're all in the group chat. π¬
π HISTORY π
c_rehash was removed in OpenSSL 4.0. use openssl rehash instead. rip to a legend but she's gone, we move on. ποΈ
π COPYRIGHT π
Copyright 2015-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 page bestie, from the 4.0.3 version dated 2026-09-29 β OPENSSL-REHASH(1SSL), written and shipped by the OpenSSL crew π«Άβ¨ tysm for reading, u ate that ngl π
π
π¦ 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