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

Commit

Permalink
Minimal project to verify excluded protocols in SslContextFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi committed Oct 29, 2020
0 parents commit 8cca87f
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,18 @@
name: Build
on: push
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
java_version: ['8', '11', '15']
os: ['ubuntu-latest','macos-latest','windows-latest']
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1.4.3
with:
java-version: ${{ matrix.java_version }}
- name: Build
run: mvn -B -V -ntp verify
48 changes: 48 additions & 0 deletions pom.xml
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.joschi</groupId>
<artifactId>jetty-5531</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<url>https://github.com/eclipse/jetty.project/issues/5531</url>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>9.4.33.v20201020</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.7.0</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.18.0</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
21 changes: 21 additions & 0 deletions src/test/java/SslContextFactoryTest.java
@@ -0,0 +1,21 @@
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

import static org.assertj.core.api.Assertions.assertThat;

public class SslContextFactoryTest {
@Test
public void testDumpExcludedProtocols() throws Exception {
SslContextFactory.Server cf = new SslContextFactory.Server();
cf.setKeyStorePassword("storepwd");
cf.setKeyManagerPassword("keypwd");
cf.setExcludeProtocols("SSL.*", "TLSv1", "TLSv1\\.[01]");
cf.start();

// Confirm behavior in engine
String[] enabledProtocols = cf.newSSLEngine().getEnabledProtocols();
assertThat(enabledProtocols).doesNotContain("TLSv1.1");
}
}

0 comments on commit 8cca87f

Please sign in to comment.