Skip to content

unhandled "slice bounds out of range [:-1]" when SAN_URI doesn't contain ):// #566

@jiang-gao

Description

@jiang-gao

PROBLEM SUMMARY

the code here raises slice bounds out of range [:-1] error when the SAN_URI doesn't contain ):// - because missing ):// makes index=-1, which isn't valid for val[1:index]. For our use case, the value for URI (SAN) in the issue_template is .*

Image

STEPS TO REPRODUCE

  1. set the Terraform with csr_origin = "service"
  2. set URI (SAN) in the issue_template with .*
resource "venafi_certificate" "mdc_server" {
  common_name = "test.test1.com"
  san_dns = [
    "test.test1.com",
    "test.test2.com",
    "test.test3.com"
  ]
  algorithm    = "RSA"
  rsa_bits     = "2048"
  valid_days   = "15"
  organization = "mycompany"
  country      = "US"
  state        = "New York"
  locality     = "New York"
  csr_origin   = "service"
  key_password = "_123456TdafdsadasdesR!"
}

The below error pops up:
Image

COMMENTS/WORKAROUNDS

Disabling URI (SAN) is a workaround

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions