Skip to content

Commit

Permalink
aspire: Set allowInsecure to true for internal services (#3044)
Browse files Browse the repository at this point in the history
In addition to setting `allowInscure` for HTTP2 (i.e. gRPC) services,
we now also set this to true by default for any service that is not
publicly exposed.

This allows inscure traffic to internal nodes, to allow requests to
things like `http://backend` from one internal service to another.

Fixes #3201
  • Loading branch information
ellismg authored Dec 1, 2023
1 parent 32c74ad commit 862bbf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/azd/pkg/apphost/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func (b *infraGenerator) Compile() error {
External: binding.External,
TargetPort: *binding.ContainerPort,
Transport: binding.Transport,
AllowInsecure: strings.ToLower(binding.Transport) == "http2",
AllowInsecure: strings.ToLower(binding.Transport) == "http2" || !binding.External,
}
}

Expand Down Expand Up @@ -460,7 +460,7 @@ func (b *infraGenerator) Compile() error {
//
// Note that the protocol type is apparently optional.
TargetPort: 8080,
AllowInsecure: strings.ToLower(binding.Transport) == "http2",
AllowInsecure: strings.ToLower(binding.Transport) == "http2" || !binding.External,
}
}

Expand Down

0 comments on commit 862bbf1

Please sign in to comment.