Dirkjan Bussink e20fe54f3f Bump minimum version requirement for OpenSSL
This updates the minimum version requirement for OpenSSL in the
documentation to 1.0.1 and also updates the practical minimum CMake

Why pick 1.0.1 as the minimum? Main reason is whatever is still out
there with long term support contracts etc. One of the oldest I could
find is Ubuntu 14.04 which still has paid extended support and is on

Another reason that 1.0.1 is probably a good minimum is a bit more
involved. 1.0.1 is the first version to add TLS 1.2. Large parts of the
internet have TLS 1.2 as a minimum requirement. This means that systems
with OpenSSL older than 1.0.1 already can't access large parts of the
internet anyway, so not supporting the latest libssh there either is ok
I think.

Bumping minimum support also means things like the HMAC API can be moved
to the more recent EVP style APIs and things can be more easily made
compatible with the deprecated APIs in OpenSSL 3.0.

Signed-off-by: Dirkjan Bussink <>
Reviewed-by: Jakub Jelen <>
Reviewed-by: Andreas Schneider <>
2020-12-22 09:15:38 +01:00

121 lines
3.4 KiB

# How to build from source
## Requirements
### Common requirements
In order to build libssh, you need to install several components:
- A C compiler
- [CMake]( >= 3.3.0
- [openssl]( >= 1.0.1
- [gcrypt]( >= 1.4
- [libz]( >= 1.2
- [cmocka]( >= 1.1.0
- [socket_wrapper]( >= 1.1.5
- [nss_wrapper]( >= 1.1.2
- [uid_wrapper]( >= 1.2.0
- [pam_wrapper]( >= 1.0.1
Note that these version numbers are version we know works correctly. If you
build and run libssh successfully with an older version, please let us know.
For Windows use vcpkg:
which you can use to install openssl and zlib. libssh itself is also part of
## Building
First, you need to configure the compilation, using CMake. Go inside the
`build` dir. Create it if it doesn't exist.
GNU/Linux, MacOS X, MSYS/MinGW:
On Windows you should choose a makefile gernerator with -G or use
cmake-gui.exe ..
To enable additional client tests against a local OpenSSH server, add the
compile option -DCLIENT_TESTING=ON. These tests require an OpenSSH
server package and some wrapper libraries (see optional requirements) to
be installed.
If you're interested in server testing, then a OpenSSH client should be
installed on the system and if possible also dropbear. Once that is done
enable server support with -DWITH_SERVER=ON and enable testing of it with
## Testing build
make test
### CMake standard options
Here is a list of the most interesting options provided out of the box by
- CMAKE_BUILD_TYPE: The type of build (can be Debug Release MinSizeRel
- CMAKE_INSTALL_PREFIX: The prefix to use when running make install (Default
to /usr/local on GNU/Linux and MacOS X)
- CMAKE_C_COMPILER: The path to the C compiler
- CMAKE_CXX_COMPILER: The path to the C++ compiler
### CMake options defined for libssh
Options are defined in the following files:
- DefineOptions.cmake
They can be changed with the -D option:
### Browsing/editing CMake options
In addition to passing options on the command line, you can browse and edit
CMake options using `cmakesetup` (Windows), `cmake-gui` or `ccmake` (GNU/Linux
and MacOS X).
- Go to the build dir
- On Windows: run `cmakesetup`
- On GNU/Linux and MacOS X: run `ccmake ..`
### Useful Windows options:
If you have installed OpenSSL or ZLIB in non standard directories, maybe you
want to set:
## Installing
If you want to install libssh after compilation run:
make install
## Running
The libssh binary can be found in the `build/src` directory.
You can use `build/examples/samplessh` which is a sample client to
test libssh on UNIX.
## About this document
This document is written using [Markdown][] syntax, making it possible to
provide usable information in both plain text and HTML format. Whenever
modifying this document please use [Markdown][] syntax.