Skip to content

Commit

Permalink
fix(ssl): Fix some issues found when testing Gate with SSL (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Tomsu authored Jul 27, 2017
1 parent d8803f2 commit 5f64d01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ allprojects {
group = 'com.netflix.spinnaker.kork'

ext {
spinnakerDependenciesVersion = project.hasProperty('spinnakerDependenciesVersion') ? project.property('spinnakerDependenciesVersion') : '0.106.0-rc.1-springBoot154'
spinnakerDependenciesVersion = project.hasProperty('spinnakerDependenciesVersion') ? project.property('spinnakerDependenciesVersion') : '0.106.0-rc.4-springBoot154'
}

def checkLocalVersions = [spinnakerDependenciesVersion: spinnakerDependenciesVersion]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.netflix.spinnaker.config

import com.netflix.spinnaker.okhttp.OkHttpClientConfigurationProperties
import com.netflix.spinnaker.tomcat.x509.BlacklistingSSLImplementation
import com.netflix.spinnaker.tomcat.x509.BlacklistingX509TrustManager
import com.netflix.spinnaker.tomcat.x509.SslExtensionConfigurationProperties
import groovy.util.logging.Slf4j
import org.apache.catalina.connector.Connector
Expand Down Expand Up @@ -62,13 +63,16 @@ class TomcatConfiguration {
def handler = connector.getProtocolHandler()
if (handler instanceof AbstractHttp11JsseProtocol) {
if (handler.isSSLEnabled()) {
SSLHostConfig sslHostConfig = new SSLHostConfig();
def sslConfigs = connector.findSslHostConfigs()
if (sslConfigs.size() != 1) {
throw new RuntimeException("Ssl configs: found ${sslConfigs.size()}, expected 1.")
}
handler.setSslImplementationName(BlacklistingSSLImplementation.name)
SSLHostConfig sslHostConfig = sslConfigs.first()
sslHostConfig.setHonorCipherOrder("true")
sslHostConfig.ciphers = okHttpClientConfigurationProperties.cipherSuites.join(",")
sslHostConfig.setProtocols(okHttpClientConfigurationProperties.tlsVersions.join(","))
sslHostConfig.setTrustManagerClassName(BlacklistingSSLImplementation.name)
sslHostConfig.setCertificateRevocationListFile(sslExtensionConfigurationProperties.getCrlFile())
handler.addSslHostConfig(sslHostConfig)
}
}
}
Expand Down

0 comments on commit 5f64d01

Please sign in to comment.