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