Skip to content

Commit

Permalink
Update RabbitMQ HTTP Connections with TLS Config
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Steicke <nicholas.steicke@alcidion.com>
  • Loading branch information
nicholass-alcidion committed Apr 9, 2024
1 parent e7ff90a commit 08dfc55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Here is an overview of all new **experimental** features:
- **General**: Validate empty array value of triggers in ScaledObject/ScaledJob creation ([#5520](https://github.com/kedacore/keda/issues/5520))
- **GitHub Runner Scaler**: Fixed `in_progress` detection on running jobs instead of just `queued` ([#5604](https://github.com/kedacore/keda/issues/5604))
- **New Relic Scaler**: Consider empty results set from query executer ([#5619](https://github.com/kedacore/keda/pull/5619))
- **RabbitMQ Scaler**: HTTP Connections respect TLS configuration ([#5668](https://github.com/kedacore/keda/issues/5668))

### Deprecations

Expand Down
8 changes: 8 additions & 0 deletions pkg/scalers/rabbitmq_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ func NewRabbitMQScaler(config *scalersconfig.ScalerConfig) (Scaler, error) {
s.metadata = meta
s.httpClient = kedautil.CreateHTTPClient(meta.timeout, meta.unsafeSsl)

if meta.enableTLS {
tlsConfig, tlsErr := kedautil.NewTLSConfigWithPassword(meta.cert, meta.key, meta.keyPassword, meta.ca, meta.unsafeSsl)
if tlsErr != nil {
return nil, tlsErr
}
s.httpClient.Transport = kedautil.CreateHTTPTransportWithTLSConfig(tlsConfig)
}

if meta.protocol == amqpProtocol {
// Override vhost if requested.
host := meta.host
Expand Down

0 comments on commit 08dfc55

Please sign in to comment.