1{
2 stdenv,
3 fetchFromGitHub,
4 makeWrapper,
5 lib,
6 dnsutils,
7 coreutils,
8 openssl,
9 net-tools,
10 util-linux,
11 procps,
12}:
13
14stdenv.mkDerivation rec {
15 pname = "testssl.sh";
16 version = "3.2.1";
17
18 src = fetchFromGitHub {
19 owner = "drwetter";
20 repo = "testssl.sh";
21 rev = "v${version}";
22 sha256 = "sha256-jVrEgTgAvu/N0Ijdl4Lya05Q/af7jGTlJBNiYt1X3tI=";
23 };
24
25 nativeBuildInputs = [ makeWrapper ];
26 buildInputs = [
27 coreutils # for printf
28 dnsutils # for dig
29 net-tools # for hostname
30 openssl # for openssl
31 procps # for ps
32 util-linux # for hexdump
33 ];
34
35 postPatch = ''
36 substituteInPlace testssl.sh \
37 --replace TESTSSL_INSTALL_DIR:-\"\" TESTSSL_INSTALL_DIR:-\"$out\" \
38 --replace PROG_NAME=\"\$\(basename\ \"\$0\"\)\" PROG_NAME=\"testssl.sh\"
39 '';
40
41 installPhase = ''
42 install -D testssl.sh $out/bin/testssl.sh
43 cp -r etc $out
44
45 wrapProgram $out/bin/testssl.sh --prefix PATH ':' ${lib.makeBinPath buildInputs}
46 '';
47
48 meta = with lib; {
49 description = "CLI tool to check a server's TLS/SSL capabilities";
50 longDescription = ''
51 CLI tool which checks a server's service on any port for the support of
52 TLS/SSL ciphers, protocols as well as recent cryptographic flaws and more.
53 '';
54 homepage = "https://testssl.sh/";
55 license = licenses.gpl2Only;
56 maintainers = with maintainers; [ etu ];
57 mainProgram = "testssl.sh";
58 };
59}