citrusframework / yaks

YAKS is a platform to enable Cloud Native BDD testing on Kubernetes
Apache License 2.0
83 stars 28 forks source link

Adding SSL certificates or disabling SSL for HTTPS clients? #500

Open stefx opened 5 months ago

stefx commented 5 months ago

Is there a way to add SSL certificates to the yaks image or disabling SSL when using HTTPS clients?

We are getting the following error when calling an HTTPS endpoint from the yaks base image. I/O error on GET request for "URL": PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

This is a very basic feature when using yaks for HTTPS integration testing. It would be great if we could disable SSL verification with a configuration.

christophd commented 5 months ago

I don't think it is possible to disable the SSL verification when using the HTTPS clients as the server requests the client to use the proper certificates.

You should be able to create a K8s secret holding the certificates and volume mount that secret into the test Pod.

christophd commented 5 months ago

https://github.com/citrusframework/yaks/tree/main/examples/secrets

stefx commented 4 months ago

Regarding the yaks usage of the secrets, it appears there is a limitation on the number of secrets that can be used by yaks. If I label two secrets with the yaks.citrusframework.org/test label, only the first one gets used and loaded in the test. Is there a possibility of using more than one secret?

christophd commented 4 months ago

Yes, I have had same issue recently, too. A fix and improvement on volume mounts of secrets in YAKS is already in the making. PR is coming soon.

With that you will be able to bind multiple secrets to a test accessing the content of the secrets either via test variables or by loading files (e.g. certificates) from a secret.

christophd commented 4 months ago

See https://github.com/citrusframework/yaks/issues/504