Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static files with SSL plugin #2084

Closed
kromar777 opened this issue Jan 30, 2024 · 1 comment
Closed

Static files with SSL plugin #2084

kromar777 opened this issue Jan 30, 2024 · 1 comment

Comments

@kromar777
Copy link

Actual behavior (the bug)
Just added SslPlugin 6.0 to the HelloWorldStaticFiles (Javalin 6.0, not tryed another versions) example and start getting Server Error for any request.

[JettyServerThreadPool-25] WARN io.javalin.Javalin - Uncaught exception java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.server.HttpConnection.getHttpChannel()" because the return value of "org.eclipse.jetty.server.HttpConnection.getCurrentConnection()" is null at io.javalin.jetty.JettyResourceHandler.jettyRequest(JettyResourceHandler.kt:84) at io.javalin.jetty.JettyResourceHandler.access$jettyRequest(JettyResourceHandler.kt:33) at io.javalin.jetty.JettyResourceHandler$nonSkippedHandlers$1.invoke(JettyResourceHandler.kt:87) at io.javalin.jetty.JettyResourceHandler$nonSkippedHandlers$1.invoke(JettyResourceHandler.kt:87) ...

Expected behavior
Get 200 response and static file content

To Reproduce
Add SslPlugin into HelloWorldStaticFiles example and provide some keystore.
`public class HelloWorldStaticFiles {

public static void main(String[] args) {
    SslPlugin sslPlugin = new SslPlugin(conf -> {
        conf.keystoreFromPath("server_keystore.p12", "password");
        conf.securePort = 7071;
        conf.insecure = false;
        conf.sniHostCheck = false;
    });

    Javalin.create(config -> {
        config.registerPlugin(sslPlugin);
        config.staticFiles.add("/public", Location.CLASSPATH);
    }).start();
}

}`

Additional context
Actually I'm fresh new to Javalin and maybe missing something.
But SslPlugin works OK with "normal" handlers like app.post("/service/jsonrpc", this::handleJsonRpcRequest);

@tipsy tipsy transferred this issue from javalin/javalin Jan 30, 2024
@tipsy tipsy transferred this issue from javalin/javalin-ssl Jan 30, 2024
@tipsy
Copy link
Member

tipsy commented Feb 2, 2024

Fixed in #2087

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants