Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Add skip cert verify config to logmon
Browse files Browse the repository at this point in the history
[#160111284]

Signed-off-by: Tom Chen <[email protected]>
  • Loading branch information
Travis Patterson authored and chentom88 committed Oct 31, 2018
1 parent 4f9a7d8 commit 47ad17c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ typical business day).
The following environment variables are used to configure test output and
rates:
* `LOGMON_SKIP_CERT_VERIFY` - Whether to skip ssl validation when connecting to CF
* `LOGMON_PRODUCTION_LOG_CYCLES` - The number of logs to emit during each test
* `LOGMON_PRODUCTION_LOG_DURATION_MILLIS` - The amount of time in milliseconds
during which the logs will be emitted.
Expand Down
9 changes: 9 additions & 0 deletions bin/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@
print "Log Duration Milliseconds Per Test: (default: 1000) "
log_duration_millis = $stdin.gets.chomp

print "Skip SSL Validation? [y/N] "
skip_ssl = $stdin.gets.chomp

skip_validate_ssl = false
if skip_ssl == "y"
skip_validate_ssl = true
end

if log_cycles.empty?
log_cycles = 1000
end
Expand All @@ -110,6 +118,7 @@
'LOGMON_PRODUCTION_LOG_CYCLES' => log_cycles,
'LOGMON_PRODUCTION_LOG_BYTE_SIZE' => log_byte_size,
'LOGMON_PRODUCTION_LOG_DURATION_MILLIS' => log_duration_millis,
'LOGMON_SKIP_CERT_VERIFY' => skip_validate_ssl,
}
}]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package org.cloudfoundry.loggregator.logmon.cf

import org.cloudfoundry.client.CloudFoundryClient
Expand All @@ -13,6 +14,7 @@ import org.cloudfoundry.uaa.UaaClient
import org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.context.annotation.Bean
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration

@Configuration
Expand All @@ -25,6 +27,9 @@ open class CfConfiguration {
lateinit var password: String
}

@Value("\${logmon.skip-cert-verify}")
private var skipCertVerify: Boolean = false

@Bean
open fun cfApiHost(cfApplicationEnv: CfApplicationEnv): String = cfApplicationEnv.cfApi.host

Expand All @@ -42,6 +47,7 @@ open class CfConfiguration {
open fun connectionContext(cfApiHost: String): DefaultConnectionContext {
return DefaultConnectionContext.builder()
.apiHost(cfApiHost)
.skipSslValidation(skipCertVerify)
.build()
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ vcap:
space-id: unknown

logmon:
skip-cert-verify: false
anomalies:
sample-size: 5
auth:
Expand Down

0 comments on commit 47ad17c

Please sign in to comment.