Skip to content

Acceptance tests: Use 2048 bit private keys in test data.#736

Merged
andrewsomething merged 2 commits intomainfrom
asb/accpt-tests-certs
Nov 1, 2021
Merged

Acceptance tests: Use 2048 bit private keys in test data.#736
andrewsomething merged 2 commits intomainfrom
asb/accpt-tests-certs

Conversation

@andrewsomething
Copy link
Copy Markdown
Member

We have a number of new acceptance test failures around certificates. The API recently began enforcing that customer certificates use private keys using a minimum of 2048 bits (RSA) or 224 bits (ECDSA). The dummy test data we've been generating is only 1024 bits. This fixes these errors:

=== CONT  TestAccDigitalOceanLoadbalancer_sslCertByName
    resource_digitalocean_loadbalancer_test.go:404: Step 1/1 error: Error running apply: exit status 1
        
        Error: Error creating Certificate: POST https://api.digitalocean.com/v2/certificates: 422 (request "242f60e5-2a57-48fe-83ff-2f84b5d4c82e") Invalid certificate data: the provided private key is not a minimum of 2048 bits (RSA) or 224 bits (ECDSA)
        
          with digitalocean_certificate.foobar,
          on terraform_plugin_test.tf line 2, in resource "digitalocean_certificate" "foobar":
           2: resource "digitalocean_certificate" "foobar" {
        
--- FAIL: TestAccDigitalOceanLoadbalancer_sslCertByName (8.82s)


=== CONT  TestAccDigitalOceanLoadbalancer_sslTermination
    resource_digitalocean_loadbalancer_test.go:359: Step 1/1 error: Error running apply: exit status 1
        
        Error: Error creating Certificate: POST https://api.digitalocean.com/v2/certificates: 422 (request "f5149f70-1b97-45c5-b306-26531b204099") Invalid certificate data: the provided private key is not a minimum of 2048 bits (RSA) or 224 bits (ECDSA)
        
          with digitalocean_certificate.foobar,
          on terraform_plugin_test.tf line 2, in resource "digitalocean_certificate" "foobar":
           2: resource "digitalocean_certificate" "foobar" {
        
--- FAIL: TestAccDigitalOceanLoadbalancer_sslTermination (9.21s)


=== CONT  TestAccDigitalOceanCertificate_Basic
    resource_digitalocean_certificate_test.go:95: Step 1/1 error: Error running apply: exit status 1
        
        Error: Error creating Certificate: POST https://api.digitalocean.com/v2/certificates: 422 (request "9db0ed5f-8f4e-4bca-ae30-5b2036892a10") Invalid certificate data: the provided private key is not a minimum of 2048 bits (RSA) or 224 bits (ECDSA)
        
          with digitalocean_certificate.foobar,
          on terraform_plugin_test.tf line 2, in resource "digitalocean_certificate" "foobar":
           2: resource "digitalocean_certificate" "foobar" {
        
--- FAIL: TestAccDigitalOceanCertificate_Basic (0.99s)


=== CONT  TestAccDigitalOceanCertificate_importBasic
    import_digitalocean_certificate_test.go:16: Step 1/2 error: Error running apply: exit status 1
        
        Error: Error creating Certificate: POST https://api.digitalocean.com/v2/certificates: 422 (request "45fcca71-5b1b-4f2d-8c54-e5d8f43eec36") Invalid certificate data: the provided private key is not a minimum of 2048 bits (RSA) or 224 bits (ECDSA)
        
          with digitalocean_certificate.foobar,
          on terraform_plugin_test.tf line 2, in resource "digitalocean_certificate" "foobar":
           2: resource "digitalocean_certificate" "foobar" {
        
--- FAIL: TestAccDigitalOceanCertificate_importBasic (0.97s)


=== CONT  TestAccDataSourceDigitalOceanLoadBalancer_tlsCert
    datasource_digitalocean_loadbalancer_test.go:209: Step 1/2 error: Error running apply: exit status 1
        
        Error: Error creating Certificate: POST https://api.digitalocean.com/v2/certificates: 422 (request "bf51b3b3-dd85-4771-9715-0da66652cf8d") Invalid certificate data: the provided private key is not a minimum of 2048 bits (RSA) or 224 bits (ECDSA)
        
          with digitalocean_certificate.foobar,
          on terraform_plugin_test.tf line 2, in resource "digitalocean_certificate" "foobar":
           2: resource "digitalocean_certificate" "foobar" {
        
--- FAIL: TestAccDataSourceDigitalOceanLoadBalancer_tlsCert (2.88s)


=== CONT  TestAccDataSourceDigitalOceanCertificate_Basic
    datasource_digitalocean_certificate_test.go:19: Step 1/2 error: Error running apply: exit status 1
        
        Error: Error creating Certificate: POST https://api.digitalocean.com/v2/certificates: 422 (request "dfc9d370-0b4c-45c9-96ec-914dab034229") Invalid certificate data: the provided private key is not a minimum of 2048 bits (RSA) or 224 bits (ECDSA)
        
          with digitalocean_certificate.foo,
          on terraform_plugin_test.tf line 2, in resource "digitalocean_certificate" "foo":
           2: resource "digitalocean_certificate" "foo" {
        
--- FAIL: TestAccDataSourceDigitalOceanCertificate_Basic (1.36s)

@andrewsomething andrewsomething requested a review from a team November 1, 2021 15:56
@andrewsomething andrewsomething temporarily deployed to Acceptance Tests November 1, 2021 15:58 Inactive
Copy link
Copy Markdown
Member

@bentranter bentranter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Copy Markdown
Contributor

@scotchneat scotchneat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewsomething andrewsomething temporarily deployed to Acceptance Tests November 1, 2021 16:05 Inactive
@andrewsomething andrewsomething merged commit 4567ac5 into main Nov 1, 2021
@andrewsomething andrewsomething deleted the asb/accpt-tests-certs branch November 1, 2021 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants