1{ lib
2, fetchFromGitHub
3, pytest
4, buildPythonPackage
5, nassl
6, cryptography
7, typing-extensions
8, faker
9}:
10
11buildPythonPackage rec {
12 pname = "sslyze";
13 version = "3.0.8";
14
15 src = fetchFromGitHub {
16 owner = "nabla-c0d3";
17 repo = pname;
18 rev = version;
19 sha256 = "06mwzxw6xaqin2gwzcqb9r7qhbyx3k7zcxygxywi2bpxyjv9lq32";
20 };
21
22 patchPhase = ''
23 substituteInPlace setup.py \
24 --replace "cryptography>=2.6,<=2.9" "cryptography"
25 '';
26
27 checkInputs = [ pytest ];
28
29 checkPhase = ''
30 # Most of the tests are online; hence, applicable tests are listed
31 # explicitly here
32 pytest \
33 tests/test_main.py \
34 tests/test_scanner.py \
35 tests/cli_tests/test_console_output.py \
36 tests/cli_tests/test_json_output.py \
37 tests/cli_tests/test_server_string_parser.py \
38 tests/plugins_tests/test_scan_commands.py \
39 tests/plugins_tests/certificate_info/test_certificate_utils.py \
40 -k "not (TestScanner and test_client_certificate_missing)"
41 '';
42 pythonImportsCheck = [ "sslyze" ];
43
44 propagatedBuildInputs = [ nassl cryptography typing-extensions faker ];
45
46 meta = with lib; {
47 homepage = "https://github.com/nabla-c0d3/sslyze";
48 description = "Fast and powerful SSL/TLS scanning library";
49 platforms = platforms.linux ++ platforms.darwin;
50 license = licenses.agpl3;
51 maintainers = with maintainers; [ veehaitch ];
52 };
53}