Skip to content

Commit

Permalink
fixes openziti/ziti#2032 auto ca enrollment fails with bad request
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpmartinez committed May 9, 2024
1 parent a7652be commit 5839076
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ziti/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (

var EnrollUrl, _ = url.Parse("/edge/client/v1/enroll")

const EnrollmentMethodCa = "ca"

type Versions struct {
Api string `json:"api"`
EnrollmentApi string `json:"enrollmentApi"`
Expand All @@ -48,7 +50,11 @@ func (t *EnrollmentClaims) EnrolmentUrl() string {

query := enrollmentUrl.Query()
query.Add("method", t.EnrollmentMethod)
query.Add("token", t.ID)

if t.EnrollmentMethod != EnrollmentMethodCa {
query.Add("token", t.ID)
}

enrollmentUrl.RawQuery = query.Encode()

return enrollmentUrl.String()
Expand Down

0 comments on commit 5839076

Please sign in to comment.