nixpkgs/pkgs/applications/networking/testssl/default.nix

50 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, makeWrapper, lib
2020-11-24 15:29:28 +00:00
, dnsutils, coreutils, openssl, nettools, util-linux, procps }:
stdenv.mkDerivation rec {
pname = "testssl.sh";
2021-03-10 02:14:10 +00:00
version = "3.0.4";
src = fetchFromGitHub {
owner = "drwetter";
repo = pname;
rev = version;
2021-03-10 02:14:10 +00:00
sha256 = "sha256-Rcvkzw1DfoRXrk0vlpL6CojEHYfYga3voc2hm4qxdmw=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
coreutils # for pwd and printf
dnsutils # for dig
nettools # for hostname
openssl # for openssl
procps # for ps
2020-11-24 15:29:28 +00:00
util-linux # for hexdump
];
postPatch = ''
substituteInPlace testssl.sh \
--replace /bin/pwd pwd \
--replace TESTSSL_INSTALL_DIR:-\"\" TESTSSL_INSTALL_DIR:-\"$out\" \
--replace PROG_NAME=\"\$\(basename\ \"\$0\"\)\" PROG_NAME=\"testssl.sh\"
'';
installPhase = ''
install -D testssl.sh $out/bin/testssl.sh
cp -r etc $out
wrapProgram $out/bin/testssl.sh --prefix PATH ':' ${lib.makeBinPath buildInputs}
'';
meta = with lib; {
description = "CLI tool to check a server's TLS/SSL capabilities";
longDescription = ''
CLI tool which checks a server's service on any port for the support of
TLS/SSL ciphers, protocols as well as recent cryptographic flaws and more.
'';
homepage = "https://testssl.sh/";
license = licenses.gpl2;
maintainers = with maintainers; [ etu ];
};
}