Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bash script that creates certificates for tests #3549

Open
olegbespalov opened this issue Sep 15, 2023 · 1 comment
Open

A bash script that creates certificates for tests #3549

olegbespalov opened this issue Sep 15, 2023 · 1 comment

Comments

@olegbespalov
Copy link
Contributor

What?

We have a couple of certificates that are used in the test hardcoded:

https://github.com/grafana/xk6-grpc/blob/0250ce4280190b0fec8452404cd5456f291b5879/grpc/client_test.go#L860-L865

If we need to regenerate certificates quickly (let's say it expired), we must figure out how.

For instance, the certificate that is hardcoded in clientAuthBad expires in 2024:

 openssl x509 -in bad_cert.pem -text -noout
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            24:86:4a:89:1e:fc:00:7d:a2:a1:9f:89:69:ef:ec:12:58:07:f3:99
        Signature Algorithm: ecdsa-with-SHA256
        Issuer: CN = My CA
        Validity
            Not Before: Jul  7 10:26:46 2023 GMT
            Not After : Jul  6 10:26:46 2024 GMT

The grpc/grpc-go has an excellent example of how to solve this by having a tiny bash script. So we could do something similar.

Why?

This improves test maintainability and developer UX.

@olegbespalov
Copy link
Contributor Author

An alternative could be for sure generation certificates on the fly.

@joanlopez joanlopez mentioned this issue Jan 18, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant