admin-shell-io / aas-test-engines

Official test tooling for the Asset Administration Shell
https://certification.admin-shell-io.com
Apache License 2.0
5 stars 2 forks source link

Not working with self-signed HTTPS certificates #11

Closed mjacoby closed 1 month ago

mjacoby commented 3 months ago

When running the API test against a server using a self-signed SSL certificate I receive the following error message

Failed to reach: HTTPSConnectionPool(host='localhost', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:997)')))

Any tips on how I can resolve this? Can I even do this on my end (e.g. using CLI arguments or environment variables) or does this require code changes on your side?

FYI, if you need a server with self-signed certificate to reproduce the error or test against, you can use FA³ST Service, e.g. just start it via docker container with docker run -p 443:443 fraunhoferiosb/faaast-service:1.0.0

otto-ifak commented 2 months ago

Thanks for reporting this @mjacoby. We will address this with the upcoming release.

otto-ifak commented 1 month ago

Implemented as follows now:

Usign cli:

python -m aas_test_engines check_server https://localhost --suite 'Asset Administration Shell API' --no-verify

Usign the python interface:

from aas_test_engines import api

tests = api.generate_tests('3.0', set(['Asset Administration Shell API']))
exec_conf = api.run.ExecConf(
    server="http://localhost",
    verify=False,
)
api.execute_tests(tests, exec_conf)

(Will be released with the next version on pypi)