diff --git a/.github/README.md b/.github/README.md index 2e82c95..d3b5cbe 100644 --- a/.github/README.md +++ b/.github/README.md @@ -2,8 +2,8 @@ * [:heart: Sponsor Javalin](https://github.com/sponsors/tipsy) * The main project webpage is [javalin.io](https://javalin.io) -* Chat on Discord: https://discord.gg/sgak4e5NKv -* License summary: https://tldrlegal.com/license/apache-license-2.0-(apache-2.0) +* Chat on Discord: +* License summary: # SSL Plugin [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/javalin/javalin-ssl/main.yaml?branch=main&label=main&logo=githubactions&logoColor=white)](https://github.com/javalin/javalin-ssl/actions?query=branch%3Amain) [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/javalin/javalin-ssl/main.yaml?branch=dev&label=dev&logo=githubactions&logoColor=white)](https://github.com/javalin/javalin-ssl/actions?query=branch%3Adev) [![Coverage](https://codecov.io/gh/javalin/javalin-ssl/branch/dev/graphs/badge.svg)](https://app.codecov.io/gh/javalin/javalin-ssl) [![javadoc](https://javadoc.io/badge2/io.javalin.community.ssl/ssl-plugin/javadoc.svg)](https://javadoc.io/doc/io.javalin.community.ssl/ssl-plugin) @@ -15,24 +15,24 @@ If you're not familiar with the HTTPS protocol we have a great guide at the [Jav [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/javalin/javalin-ssl?label=Latest%20Release)](https://github.com/javalin/javalin-ssl/releases) [![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo.reposilite.com%2Fsnapshots%2Fio%2Fjavalin%2Fcommunity%2Fssl%2Fssl-plugin%2Fmaven-metadata.xml&label=Latest%20Snapshot)](https://repo.reposilite.com/#/snapshots/io/javalin/community/ssl/ssl-plugin) - As simple as adding a dependency: + ### Maven ```xml io.javalin.community.ssl ssl-plugin - 5.6.3 + 6.0.0 ``` + ### Gradle ```kotlin -implementation('io.javalin.community.ssl:ssl-plugin:5.6.3') +implementation('io.javalin.community.ssl:ssl-plugin:6.0.0') ``` - ## Configuration You can pass a config object when registering the plugin @@ -54,7 +54,7 @@ Javalin.create(config->{ ```kotlin Javalin.create { config -> ... // your Javalin config here - config.registerPlugin(SSL) { + config.registerPlugin(SslPlugin{ ... // your SSL configuration here it.pemFromPath("/path/to/cert.pem", "/path/to/key.pem") } @@ -110,6 +110,7 @@ If you want to verify the client certificates (such as mTLS) you can set the tru In contrast to the identity configuration, you can load multiple certificates from different sources. By adding a `TrustConfig` to the `SslPlugin` you will enable client certificate verification. + ```java config.plugins.register(new SslPlugin(ssl->{ ssl.pemFromPath("/path/to/cert.pem","/path/to/key.pem"); // Load our identity data @@ -135,8 +136,8 @@ trustStoreFromClasspath("truststore.jks", "password"); // load a trust sto trustStoreFromInputStream(inputStream, "password"); // load a trust store from the given input stream ``` - #### Hot reloading + Certificate reloading is supported, if you want to replace the certificate you can simply call `SslPlugin.reload()` with the new configuration. ```kotlin @@ -161,23 +162,21 @@ sslPlugin.reload { trust.certificateFromPath("path/to/new/certificate.pem"); } } -``` - - +``` ## Notes -- HTTP/2 **can** be used over an insecure connection. -- If Jetty responds with an `HTTP ERROR 400 Invalid SNI`, you can disable SNI verification by +* HTTP/2 **can** be used over an insecure connection. +* If Jetty responds with an `HTTP ERROR 400 Invalid SNI`, you can disable SNI verification by setting `sniHostCheck = false`. -- Minimizing your jar can lead to issues, [more info](https://github.com/javalin/javalin-ssl/issues/59). +* Minimizing your jar can lead to issues, [more info](https://github.com/javalin/javalin-ssl/issues/59). ## Depends on | Package | Version | License | |-----------------------------------------------|---------|----------------------------------------------------------------------------------------------------------------------| -| [Javalin](https://github.com/javalin/javalin) | `5.6.3` | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | - | [SSLContext Kickstart](https://github.com/Hakky54/sslcontext-kickstart) | `8.1.4` | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | +| [Javalin](https://github.com/javalin/javalin) | `6.0.0` | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | + | [SSLContext Kickstart](https://github.com/Hakky54/sslcontext-kickstart) | `8.3.0` | [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | ## Contributing @@ -185,11 +184,6 @@ Contributions are welcome! Open an issue or pull request if you have a suggestio All development is carried out on the dev branch, main is only used for releases. - ## License This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details - - - - diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3cf075f..4369bbb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -19,7 +19,7 @@ jobs: - name: Set up JDK ${{ matrix.java_version }} uses: actions/setup-java@v4.0.0 with: - distribution: 'zulu' + distribution: "zulu" java-version: ${{ matrix.java_version }} - name: Validate Wrapper uses: gradle/wrapper-validation-action@v1 @@ -37,8 +37,8 @@ jobs: - name: Setup Java JDK uses: actions/setup-java@v4.0.0 with: - distribution: 'temurin' - java-version: '17' + distribution: "temurin" + java-version: "17" - name: Checkout Code uses: actions/checkout@v4 @@ -71,15 +71,15 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4.0.0 with: - distribution: 'zulu' - java-version: '17' + distribution: "zulu" + java-version: "17" - name: Generate version uses: HardNorth/github-version-generate@v1.3.0 with: version-source: file version-file: build.gradle.kts - version-file-extraction-pattern: '(?<=version\s*=\s*"")\S+(?="")' + version-file-extraction-pattern: '(?<=version\s*=\s*")\S+(?=")' - name: Validate Wrapper uses: gradle/wrapper-validation-action@v1 @@ -87,11 +87,11 @@ jobs: - name: Publish to Reposilite uses: gradle/gradle-build-action@v2.11.1 env: - MAVEN_NAME: '${{ secrets.MAVEN_NAME }}' - MAVEN_TOKEN: '${{ secrets.MAVEN_TOKEN }}' - ORG_GRADLE_PROJECT_signingKey: '${{ secrets.GPG_KEY }}' - ORG_GRADLE_PROJECT_signingPassword: '${{ secrets.GPG_PASSPHRASE }}' - ORG_GRADLE_PROJECT_signingKeyId: '${{ secrets.GPG_KEYID }}' + MAVEN_NAME: "${{ secrets.MAVEN_NAME }}" + MAVEN_TOKEN: "${{ secrets.MAVEN_TOKEN }}" + ORG_GRADLE_PROJECT_signingKey: "${{ secrets.GPG_KEY }}" + ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.GPG_PASSPHRASE }}" + ORG_GRADLE_PROJECT_signingKeyId: "${{ secrets.GPG_KEYID }}" with: arguments: publishMavenPublicationToReposiliteRepository @@ -99,11 +99,11 @@ jobs: if: "!contains(env.CURRENT_VERSION, 'SNAPSHOT')" uses: gradle/gradle-build-action@v2.11.1 env: - ORG_GRADLE_PROJECT_sonatypeUsername: '${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}' - ORG_GRADLE_PROJECT_sonatypePassword: '${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}' - ORG_GRADLE_PROJECT_signingKey: '${{ secrets.GPG_KEY }}' - ORG_GRADLE_PROJECT_signingPassword: '${{ secrets.GPG_PASSPHRASE }}' - ORG_GRADLE_PROJECT_signingKeyId: '${{ secrets.GPG_KEYID }}' + ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}" + ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}" + ORG_GRADLE_PROJECT_signingKey: "${{ secrets.GPG_KEY }}" + ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.GPG_PASSPHRASE }}" + ORG_GRADLE_PROJECT_signingKeyId: "${{ secrets.GPG_KEYID }}" with: arguments: publishToSonatype closeAndReleaseStagingRepository @@ -164,8 +164,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4.0.0 with: - distribution: 'zulu' - java-version: '17' + distribution: "zulu" + java-version: "17" - name: Validate Wrapper uses: gradle/wrapper-validation-action@v1 @@ -173,10 +173,10 @@ jobs: - name: Publish to Reposilite uses: gradle/gradle-build-action@v2.11.1 env: - MAVEN_NAME: '${{ secrets.MAVEN_NAME }}' - MAVEN_TOKEN: '${{ secrets.MAVEN_TOKEN }}' - ORG_GRADLE_PROJECT_signingKey: '${{ secrets.GPG_KEY }}' - ORG_GRADLE_PROJECT_signingPassword: '${{ secrets.GPG_PASSPHRASE }}' - ORG_GRADLE_PROJECT_signingKeyId: '${{ secrets.GPG_KEYID }}' + MAVEN_NAME: "${{ secrets.MAVEN_NAME }}" + MAVEN_TOKEN: "${{ secrets.MAVEN_TOKEN }}" + ORG_GRADLE_PROJECT_signingKey: "${{ secrets.GPG_KEY }}" + ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.GPG_PASSPHRASE }}" + ORG_GRADLE_PROJECT_signingKeyId: "${{ secrets.GPG_KEYID }}" with: arguments: publishMavenPublicationToReposiliteRepository diff --git a/build.gradle.kts b/build.gradle.kts index b922675..1a53acd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,7 +16,7 @@ plugins { group = "io.javalin.community.ssl" //Must be formatted following the RegEx: /version\s*=\s*"\S+"/g -version = "6.0.0-SNAPSHOT" +version = "6.0.0" jacoco { toolVersion = "0.8.8" @@ -33,7 +33,7 @@ repositories { } dependencies { - val javalin = "6.0.0-beta.4" + val javalin = "6.0.0" val sslContextKickstart = "8.3.0" val annotations = "24.1.0"