wbond / certvalidator

Python library for validating X.509 certificates and paths
MIT License
107 stars 31 forks source link

Errors in testing #45

Open Nilsonfsilva opened 10 months ago

Nilsonfsilva commented 10 months ago

Hey! I decided to keep your package in the Debian project. It is already under analysis. Soon it will be in the official distribution repositories. As dependencies undergo constant updates, Debian uses "tests" as a verification tool to find out whether the codes have not been affected by any update.

And cetvalidator is showing errors in tests, both at build time and isolated with "pytest".

Below are the two records for investigation. CONSTRUCTION TIME: termediate) ... ok test_openssl_ocsp_direct_with_intermediate_success (tests.test_validate.ValidateTests.test_openssl_ocsp_direct_with_intermediate_success) ... ok test_revocation_mode_hard (tests.test_validate.ValidateTests.test_revocation_mode_hard) ... ERROR test_revocation_mode_soft (tests.test_validate.ValidateTests.test_revocation_mode_soft) ... ERROR

====================================================================== ERROR: test_basic_certificate_validator_tls (tests.test_certificate_validator.CertificateValidatorTests.test_basic_certificate_validator_tls)

Traceback (most recent call last): File "/pkgs/trabalhando/PACOTES-PRONTOS/certivalidador/python-certvalidator/tests/testcertificatevalidator.py", line 44, in test_basic_certificate_validator_tls path = validator.validate_tls('codexns.io') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/pkgs/trabalhando/PACOTES-PRONTOS/certivalidador/python-certvalidator/certvalidator/init.py", line 222, in validate_tls self._validate_path() File "/pkgs/trabalhando/PACOTES-PRONTOS/certivalidador/python-certvalidator/certvalidator/init.py", line 108, in _validate_path paths = self.context.certificateregistry.build_paths(self._certificate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/pkgs/trabalhando/PACOTES-PRONTOS/certivalidador/python-certvalidator/certvalidator/registry.py", line 314, in build_paths raise PathBuildingError(pretty_message( certvalidator.errors.PathBuildingError: Unable to build a validation path for the certificate "Common Name: codexns.io, Organization: Codex Non Sufficit LC, Locality: Newbury, State/Province: Massachusetts, Country: US, Serial Number: 471714639, Business Category: Private Organization, Incorporation State/Province: Massachusetts, Incorporation Country: US" - no issuer matching "Common Name: GeoTrust Primary Certification Authority, Organization: GeoTrust Inc., Country: US" was found

====================================================================== ERROR: test_basic_certificate_validator_tls_expired (tests.test_certificate_validator.CertificateValidatorTests.test_basic_certificate_validator_tls_expired)

Traceback (most recent call last): File "/pkgs/trabalhando/PACOTES-PRONTOS/certivalidador/python-certvalidator/tests/testcertificatevalidator.py", line 54, in test_basic_certificate_validator_tls_expired validator.validate_tls('codexns.io') File "/pkgs/trabalhando/PACOTES-PRONTOS/certivalidador/python-certvalidator/certvalidator/init.py", line 222, in validate_tls self._validate_path() File "/pkgs/trabalhando/PACOTES-PRONTOS/certivalidador/python-certvalidator/certvalidator/init.py", line 108, in _validate_path paths = self.context.certificateregistry.build_paths(self._certificate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/pkgs/trabalhando/PACOTES-PRONTOS/certivalidador/python-certvalidator/certvalidator/registry.py", line 314, in build_paths raise PathBuildingError(pretty_message( certvalidator.errors.PathBuildingError: Unable to build a validation path for the certificate "Common Name: codexns.io, Organization: Codex Non Sufficit LC, Locality: Newbury, State/Province: Massachusetts, Country: US, Serial Number: 471714639, Business Category: Private Organization, Incorporation State/Province: Massachusetts, Incorporation Country: US" - no issuer matching "Common Name: GeoTrust Primary Certification Authority, Organization: GeoTrust Inc., Country: US" was found

====================================================================== ERROR: test_basic_certificate_validator_tls_invalid_hostname (tests.test_certificate_validator.CertificateValidatorTests.test_basic_certificate_validator_tls_invalid_hostname)

Traceback (most recent call last):

Inglês

ISOLATED TESTS WITH PYTEST:

FAILED tests/testcertificatevalidator.py::CertificateValidatorTests::test_basic_certificate_validator_tls - certvalidator.errors.PathBuildingError: Unable to build a validation path for the certificate "Common Name: codexns.io, Organization: Codex Non Sufficit LC, Locality: Newbury, State/Pro... FAILED tests/testcertificatevalidator.py::CertificateValidatorTests::test_basic_certificate_validator_tls_expired - certvalidator.errors.PathBuildingError: Unable to build a validation path for the certificate "Common Name: codexns.io, Organization: Codex Non Sufficit LC, Locality: Newbury, State/Pro... FAILED tests/testcertificatevalidator.py::CertificateValidatorTests::test_basic_certificate_validator_tls_invalid_hostname - certvalidator.errors.PathBuildingError: Unable to build a validation path for the certificate "Common Name: codexns.io, Organization: Codex Non Sufficit LC, Locality: Newbury, State/Pro... FAILED tests/testcertificatevalidator.py::CertificateValidatorTests::test_basic_certificate_validator_tls_invalid_key_usage - certvalidator.errors.PathBuildingError: Unable to build a validation path for the certificate "Common Name: codexns.io, Organization: Codex Non Sufficit LC, Locality: Newbury, State/Pro... FAILED tests/testcertificatevalidator.py::CertificateValidatorTests::test_basic_certificate_validator_tls_whitelist - certvalidator.errors.PathBuildingError: Unable to build a validation path for the certificate "Common Name: codexns.io, Organization: Codex Non Sufficit LC, Locality: Newbury, State/Pro... FAILED tests/testcrlclient.py::CRLClientTests::test_fetch_crl - certvalidator.errors.PathBuildingError: Unable to build a validation path for the certificate "Common Name: GeoTrust EV SSL CA - G4, Organization: GeoTrust Inc., Country: US" - no issue... FAILED tests/testocspclient.py::OCSPClientTests::test_fetchocsp - certvalidator.errors.PathBuildingError: Unable to build a validation path for the certificate "Common Name: GeoTrust EV SSL CA - G4, Organization: GeoTrust Inc., Country: US" - no issue... FAILED tests/testregistry.py::RegistryTests::test_buildpaths - certvalidator.errors.PathBuildingError: Unable to build a validation path for the certificate "Common Name: codexns.io, Organization: Codex Non Sufficit LC, Locality: Newbury, State/Pro... FAILED tests/testvalidate.py::ValidateTests::test_revocation_modehard - certvalidator.errors.PathValidationError: The path could not be validated because intermediate certificate 1 expired 2022-04-13 10:00:00Z FAILED tests/testvalidate.py::ValidateTests::test_revocation_mode_soft - certvalidator.errors.PathValidationError: The path could not be validated because intermediate certificate 1 expired 2022-04-13 10:00:00Z ======================================================================== 10 failed, 203 passed, 127 warnings in 5.37s ==========