ntp.util: Fix rpeers mode in PeerSummary.summary
[ntpsec.git] / HOWTO-OpenSSL
blob2e113ac65f55b2550fe6d55ed6c5eb91709eb540
1 NTS needs TLS 1.3 or newer.
2 That was first supported in OpenSSL 1.1.1
3   (1.1.1a is broken)
4 Some OSes/Distros don't support a new enough version of OpenSSL
5 This file contains notes on how to download, build, and install 3.2.0
6 It it should be close for other 3.x.y versions
8 It's rough.  Don't be surprised by bugs/oversights.
9 Corrections, clarifications and feedback encouraged.
11 In 2023-Nov, FreeBSD 13.2 has 1.1.1t as the main version.
12 It also has 3 newer versions available as packages.
13 You can just install one and ignore the rest of this note.
14 waf will find the pkg version and use it.
15   sudo pkg update
16   sudo pkg search openssl
17 openssl30-3.0.12_1             TLSv1.3 capable SSL and crypto library
18 openssl31-3.1.4_1              TLSv1.3 capable SSL and crypto library
19 openssl32-3.2.0.a2             TLSv1.3 capable SSL and crypto library
20   sudo pkg install openssl32
21 Note: the "a2" is for "Alpha 2", not for production etc.
22 The rest of this recipe works if you want to try a newer version from
23 an OpenSSL tarball.
26 Download OpenSSL source from here:
27   https://www.openssl.org/source/
29 You should be able to cut/paste many of these lines.
30 But check for the latest versions first.
32 cd xxx
33 mkdir OpenSSL
34 cd OpenSSL
35 for OpenSSL 3.2.0
36   wget https://www.openssl.org/source/openssl-3.2.0.tar.gz
37   tar -xzf openssl-3.2.0.tar.gz
38   cd openssl-3.2.0
40 # Check NOTES.PERL
41 #   for CentOS, you need
42   sudo yum install perl-core
43 # Fedora 35 for 3.0.1
44   # ./config needs
45   sudo dnf install perl-FindBin 'perl(IPC::Cmd)' 'perl(File::Compare)'
46   # make needs
47   # make test needs
48   sudo dnf install 'perl(Test::Harness)' 'perl(Test::More)' 'perl(File::Copy)'
49   # make install also needs:
50   sudo dnf install 'perl(Pod::Html)'
51 # On FreeBSD for 3.0.1
52   sudo pkg install perl5
54 By default, this recipe will install
55   libcrypto.so.3 and libssl.so.3
56   in /usr/local/ssl/lib64/
57 and they will be used by all software, not just ntpd.
59 If you don't want that, edit VERSION.dat and change SHLIB_VERSION
60 to something like 6.  That will install the libraries as
61   libcrypto.so.6 and libssl.so.6
62 and waf will setup ntpd to use them.
63 openssl-3.2-beta breaks sudo on Fedora, so this is a good idea.   <======
65 On Linux
66   openssl version -d
67   OPENSSLDIR=`openssl version -d | sed "s/OPENSSLDIR: //"`
68   OPENSSLDIR=`echo $OPENSSLDIR | sed s/\"//g`
69   echo $OPENSSLDIR
70   ./Configure --prefix=/usr/local/ssl --openssldir=$OPENSSLDIR shared
72 ***   If you encounter a problem while building, please open an    ***
73 ***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
74 ***   and include the output from the following command:           ***
75 ***                                                                ***
76 ***       perl configdata.pm --dump                                ***
78 time make -j4         |& tee make.log
79   # Check that we got it right.  These should match.
80   openssl version -d
81   ./util/shlib_wrap.sh ./apps/openssl version -d
82   # ./apps/openssl without the wrapper will use the installed libraries
83 The above check is broken for openssl-3.2.0-beta1 on Fedora
84 It works on Ubuntu and FreeBSD.
86 time make test        |& tee test.log
87 time make build_docs  |& tee docs.log
88 sudo make install     |& tee install.log
90 sudo su
91   cd /etc/ld.so.conf.d
92   echo "/usr/local/ssl/lib" > openssl-3.2.0.conf    # 32 bit systems
93   echo "/usr/local/ssl/lib64" > openssl-3.2.0.conf  # 64 bit systems
94   # running ldconfig before install doesn't work
95   ldconfig
97 On FreeBSD:
98   ldconfig -m /usr/local/ssl/lib/
100 NetBSD:
101   echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
102 (no ldconfig on my search path.  Doesn't seem to be needed.)
104 # check with
105 /usr/local/ssl/bin/openssl version
107 # Note that the directories in the above config line need to
108 # match where wscript looks for your OS.
109 # The above works for CentOS 7