javalin / javalin-ssl

Straightforward SSL Configuration for Javalin!
https://javalin.io/plugins/ssl-helpers
10 stars 1 forks source link

Not able to connect to server #101

Closed GoldenGamerLP closed 9 months ago

GoldenGamerLP commented 1 year ago

Actual behavior (the bug) When trying to connect via https/ssl the server throws an error, and the client gets a 525 error code.

Error: java.nio.channels.SocketChannel[closed]: java.lang.IllegalStateException: Connection rejected: No ALPN Processor for sun.security.ssl.SSLEngineImpl

Expected behavior The client should be able to connect without problems, and no problems should occour on the server side.

To Reproduce Unforntatley the project is private, but i can share the depedencies.

Gradle:

 plugins {
    id 'java'
    id "com.github.johnrengelman.shadow" version "8.1.1"
}

group = 'me.alex'
version = '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation ('com.github.GoldenGamerLP:DependencyLoader:eed2460e41') {
        exclude module: 'DependencyExamples'
    }

    annotationProcessor('com.github.GoldenGamerLP:DependencyLoader:eed2460e41') {
        exclude module: 'DependencyExamples'
    }

    implementation 'org.slf4j:slf4j-simple:2.0.7'
    //Javalin
    implementation 'io.javalin:javalin:5.6.2'

    implementation 'com.github.HttpMarco:Aeon:-SNAPSHOT'
    //JsonParser
    implementation 'com.google.code.gson:gson:2.8.8'

    //Lombok
    implementation 'org.projectlombok:lombok:1.18.28'
    annotationProcessor 'org.projectlombok:lombok:1.18.28'
    //OpenAPI
    compileOnly 'io.javalin.community.openapi:javalin-openapi-plugin:5.6.2'

    implementation 'io.javalin.community.ssl:ssl-plugin:5.6.2'

    implementation ('org.eclipse.jetty:jetty-nosql:11.0.15') {
        exclude group: 'org.mongodb'
    }

    implementation 'org.mongodb:mongodb-driver-sync:4.6.0'
}

//Manifest
jar {
    manifest {
        attributes(
                'Main-Class': 'me.alex.app.street14endpoint.EndpointBootstrap',
                'Multi-Release': true
        )
    }
} 

Additional context I used a pem certificate with ssl forwarding. If you have anymore questions, feel free to ask.

GoldenGamerLP commented 1 year ago

Also more information:

Java Version: openjdk version "17.0.8.1" 2023-08-24 OpenJDK Runtime Environment (build 17.0.8.1+1-Ubuntu-0ubuntu122.04) OpenJDK 64-Bit Server VM (build 17.0.8.1+1-Ubuntu-0ubuntu122.04, mixed mode, sha ring)

OS:

Linux (Prox Mox)

Asdamp commented 10 months ago

I fixed the same issue by adding this line to my dependencies: implementation 'org.eclipse.jetty:jetty-alpn-java-server:11.0.18'

It might be a problem with the dependency imported by Javalin-SSL.

zugazagoitia commented 9 months ago

Discussed in Discord. Used custom classloading breaking Jetty's runtime Provider dependency loading.