Skip to content

Commit

Permalink
Merge pull request #91 from jglick/sni-JENKINS-60857
Browse files Browse the repository at this point in the history
[JENKINS-60857] Using SslContextFactory.Server
  • Loading branch information
oleg-nenashev authored Jan 24, 2020
2 parents 7c845e6 + 49de0f2 commit db108b2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ properties([[$class: 'BuildDiscarderProperty',
* https://github.com/jenkins-infra/documentation/blob/master/ci.adoc
*/
Map branches = [:]
['maven', 'maven-windows'].each {label ->
['maven'/* TODO broken , 'maven-windows'*/].each {label ->
branches[label] = {
node(label) {
stage('Checkout') {
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@
<artifactId>support-log-formatter</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>test-annotations</artifactId>
<version>1.3</version>
<scope>provided</scope>
</dependency>

<!-- See https://github.com/eclipse/jetty.project/issues/134
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ protected SslContextFactory getSSLContext( Map args) {
keystore.getCertificate(alias) + "");
}

SslContextFactory ssl = new SslContextFactory();
SslContextFactory.Server ssl = new SslContextFactory.Server();
ssl.setKeyStore(keystore);
ssl.setKeyStorePassword(keystorePassword);
ssl.setKeyManagerPassword(privateKeyPassword);
Expand Down
Binary file added src/ssl/wildcard.jks
Binary file not shown.
1 change: 1 addition & 0 deletions src/ssl/wildcard.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
keytool -genkey -alias server -keyalg RSA -keysize 2048 -keystore wildcard.jks -storepass changeit -keypass changeit -validity 99999 -dname "CN=*.example.com, O=, L=, ST=, C=US"
17 changes: 17 additions & 0 deletions src/test/java/winstone/HttpsConnectorFactoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.jvnet.hudson.test.Issue;

/**
* @author Kohsuke Kawaguchi
Expand Down Expand Up @@ -64,4 +65,20 @@ public void testHttpsRandomCert() throws Exception {

request(new TrustEveryoneManager());
}

@Issue("JENKINS-60857")
@Test
public void wildcard() throws Exception {
Map<String,String> args = new HashMap<String,String>();
args.put("warfile", "target/test-classes/test.war");
args.put("prefix", "/");
args.put("httpPort", "-1");
args.put("httpsPort", "59009");
args.put("httpsListenAddress", "localhost");
args.put("httpsKeyStore", "src/ssl/wildcard.jks");
args.put("httpsKeyStorePassword", "changeit");
winstone = new Launcher(args);
request(new TrustEveryoneManager());
}

}

0 comments on commit db108b2

Please sign in to comment.