I am using the jetty-12.1.6 libraries with graalvm-ce-17. I have made a Java class that starts an embedded jetty server with two connectors :
- one http on port 9000
- one https on port 9433
I started the class implementation from the example HTTP server on the jetty documentation site. Then I looked at the HTTPS example on the developer docs and adapted the class with that. The server starts up and I can make HTTP requests like I used to before putting in the HTTPS connector. I created the Java keystore based on the instructions on the operations manual and some other openssl info. Because I couldn't generate the certificate with java's key tool. It hangs in gencert. So I used openssl to do most of the job and then imported the final result into the java keystore.
Then I used curl to test https.
dlsa@besta facialrecognition % curl --trace-ascii httpreq.log --cacert jettyhttpscerts/jettyhttpscert.pem 'https://localhost:9433/auth/authorize?client_id=dlsa&redirect_uri=https://localhost:9433/auth/token?code=auth_code_123' curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:9433
I asked in the curl-users mailing list, they say that jetty is probably returning HTTP. So I am attaching the source code of the Java class where I embed the server, in the hopes someone sees something I may be doing wrong.