Skip to content

Commit

Permalink
Merge pull request #564 from openziti/fix.2032.fix.auto.ca.enrollment
Browse files Browse the repository at this point in the history
fixes openziti/ziti#2032 auto ca enrollment fails with bad request
  • Loading branch information
andrewpmartinez authored May 9, 2024
2 parents a7652be + 5839076 commit fa86b47
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 fa86b47

Please sign in to comment.