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

Support for per-vu TLS configuration (grpc.Client.connect only) #3159

Commits on Jul 2, 2023

  1. ### Support for per-vu TLS configuration (grpc.Client.connect only) a…

    …nd custom (self-signed) RootCAs
    
    You can now use self-signed ca-certificates when authenticating with TLS. Using the `cacerts` property of an options `tlsAuth` object, you can now indicate the CA certificate(s) that k6 will use to verify the server certificates your tests will access. CA certificates must be in `pem` format and multiple CA certificates can be included.
    
    ```javascript
    export const options = {
        tlsAuth: [
            {
                cacerts: [open("cacerts.pem")],
                cert: open("cert.pem"),
                key: open("cert-key.pem"),
                password: "cert-passphrase",
                domains: ["grpcbin.test.k6.io"], // Deprecated
            },
        ],
    };
    ```
    
    You can also now use per-vu TLS configuration on `grpc.Client` `connect` params. Previously, `grpc.Client` `connect` made use of a shared (immutable) `tls.Config` cloned into every VU. Now, the `connect` `params` argument can contain a `tlsconfig` key that maps to the `TLSAuth` struct. This will create a per-vu TLS configuration for the `grpc.Client` allowing you to connect to multiple mTLS endpoints in a single VU. Note: the global tls.Config will remain unmodified.
    
    ```javascript
    const params = {
        plaintext: false,
        tlsconfig: {
            cacerts: ["cacerts.pem"],
            cert: "cert.pem",
            key: "key.pem",
            password: "cert-passphrase",
            domains: ["grpcbin.test.notk6.io"], // Deprecated
        }
    };
    const hostPort = "grpcbin.test.notk6.io:9001";
    const client = new grpc.Client();
    
    client.connect(hostPort, params);
    ```
    Chris Moran committed Jul 2, 2023
    Configuration menu
    Copy the full SHA
    abbd1a8 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2023

  1. Fixed cast when cacerts is passed as a string[]

    Chris Moran committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    2c3e1c8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2da60cb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    748bbf3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    044e176 View commit details
    Browse the repository at this point in the history
  5. Added tests for grpc.Client connectParams tls option

    Chris Moran committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    9a2f3ba View commit details
    Browse the repository at this point in the history
  6. Added missed password field for encrypted certificate key on tls option

    Added tests around tls password and encrypted certificate key
    Chris Moran committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    6850c71 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2023

  1. Address security scan for "RSA Private Key exposed on GitHub" for loc…

    …alhostKey and localhostEncryptedKey. (Used the same approach `net/http/internal/testcert/testcert.go` uses)
    Chris Moran committed Jul 5, 2023
    Configuration menu
    Copy the full SHA
    4cbf416 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2023

  1. Update js/modules/k6/grpc/client.go

    Nice catch. Thank you.
    
    Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com>
    chrismoran-mica and mstoykov committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    7bec30a View commit details
    Browse the repository at this point in the history
  2. Update js/modules/k6/grpc/client.go

    Nice catch. Thank you.
    
    Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com>
    chrismoran-mica and mstoykov committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    6fe2efa View commit details
    Browse the repository at this point in the history
  3. PR Feedback

    Chris Moran committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    5d7cfd9 View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2023

  1. Cleaned (removed) prior changes to httpmultibin.go

    Added positive and negative test cases for grpc client connect with tls parameter
    Chris Moran committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    fd512e6 View commit details
    Browse the repository at this point in the history
  2. Update js/modules/k6/grpc/client.go

    Update js/modules/k6/grpc/client.go
    lib/options.go should also be updated
    
    Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com>
    chrismoran-mica and mstoykov committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    a5df2fe View commit details
    Browse the repository at this point in the history
  3. TestClient_Connect_TlsParameters renamed for clarity

    Chris Moran committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    135050c View commit details
    Browse the repository at this point in the history
  4. Merge remote-tracking branch 'origin/feature/per-vu-grpc-tls-config-w…

    …ith-rootcas' into feature/per-vu-grpc-tls-config-with-rootcas
    Chris Moran committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    36bdf7d View commit details
    Browse the repository at this point in the history
  5. Give CI some more time to verify

    Chris Moran committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    514ea16 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2023

  1. client_test housekeeping

    Chris Moran committed Jul 8, 2023
    Configuration menu
    Copy the full SHA
    a1bf3d9 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2023

  1. Configuration menu
    Copy the full SHA
    0fd36f5 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2023

  1. Remove timeout from failing test

    Unsure why the test passes locally but fails in CI
    Chris Moran committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    2d4ce15 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2023

  1. Removed timeout on failing CI test

    Chris Moran committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    f71d3e0 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2023

  1. Update js/modules/k6/grpc/client.go

    Co-authored-by: Oleg Bespalov <olegbespalov@gmail.com>
    chrismoran-mica and olegbespalov committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    c35a3b1 View commit details
    Browse the repository at this point in the history
  2. Update js/modules/k6/grpc/client.go

    Co-authored-by: Oleg Bespalov <olegbespalov@gmail.com>
    chrismoran-mica and olegbespalov committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    954e982 View commit details
    Browse the repository at this point in the history
  3. Update js/modules/k6/grpc/client.go

    Co-authored-by: Oleg Bespalov <olegbespalov@gmail.com>
    chrismoran-mica and olegbespalov committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    05132c3 View commit details
    Browse the repository at this point in the history
  4. Update js/modules/k6/grpc/client.go

    Co-authored-by: Oleg Bespalov <olegbespalov@gmail.com>
    chrismoran-mica and olegbespalov committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    e0a13c7 View commit details
    Browse the repository at this point in the history
  5. Update js/modules/k6/grpc/client.go

    Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com>
    chrismoran-mica and mstoykov committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    692387d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    af7770c View commit details
    Browse the repository at this point in the history