Hi,
Sorry for the late reply.
Please allow me to describe more clearly.
1. When my Jetty 9.3.5 server started, the below logs were shown,
2016-03-31 15:55:07.476:INFO:oejs.ServerConnector:main: Started ServerConnector@10d59286{HTTP/1.1,[http/1.1, h2c, h2c-17, h2c-16, h2c-15, h2c-14]}{
0.0.0.0:8080}
2016-03-31 15:55:08.699:INFO:oejus.SslContextFactory:main: x509=X509@5123a213(1,h=[
sc11136070.us.oracle.com],w=[]) for SslContextFactory@52525845(...)
2016-03-31 15:55:12.725:INFO:oejs.ServerConnector:main: Started ServerConnector@4be242d9{SSL,[ssl, alpn, h2, h2-17, h2-16, h2-15, h2-14, http/1.1]}{
0.0.0.0:8081}
2016-03-31 15:55:12.726:INFO:oejs.Server:main: Started @23362ms
I think it means that the server supports HTTP/2 with/without TLS. Right?
2. I used the following test codes,
public void testHttp() throws Exception, InterruptedException,
ExecutionException, TimeoutException {
String url = "" href="https://localhost:8081">https://localhost:8081";
HttpClient client = new HttpClient(sslContextFactory); // This SSL setup has no problem.
client.start();
HttpRequest request = (HttpRequest) client.newRequest(url);
System.out.println(request);
ContentResponse response = request.send();
System.out.println(response.getStatus());
client.stop();
}
And I got the below output:
2016-03-31 16:31:55.450:INFO::main: Logging initialized @522ms
HttpRequest[GET HTTP/1.1]@64bfbc86
2016-03-31 16:31:57.556:WARN:oejh.HttpParser:HttpClient@32374789-14: Illegal character 0x0 in state=START for buffer DirectByteBuffer@5684296a[p=1,l=32,c=16384,r=31]={\x00<<<\x00\x17\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01invalid_preface>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2016-03-31 16:31:57.557:WARN:oejh.HttpParser:HttpClient@32374789-14: bad HTTP parsed: 400 Illegal character 0x0 for HttpReceiverOverHTTP@1e0934bd(rsp=IDLE,failure=null)[HttpParser{s=START,0 of 0}]
Exception in thread "main" java.util.concurrent.ExecutionException: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: bad response on HttpConnectionOverHTTP@53cf69a8(l:/
127.0.0.1:62179 <-> r:localhost/
127.0.0.1:8081,closed=false)[HttpChannelOverHTTP@51de0582(exchange=HttpExchange@32b0a780 req=TERMINATED/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@654bd1b7(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@4d61769f{s=START}],recv=HttpReceiverOverHTTP@1e0934bd(rsp=IDLE,failure=null)[HttpParser{s=CLOSE,0 of 0}]]]
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118)
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101)
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:653)
at JettyClientTest.testHttp(JettyClientTest.java:44)
at JettyClientTest.main(JettyClientTest.java:105)
Caused by: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: bad response on HttpConnectionOverHTTP@53cf69a8(l:/
127.0.0.1:62179 <-> r:localhost/
127.0.0.1:8081,closed=false)[HttpChannelOverHTTP@51de0582(exchange=HttpExchange@32b0a780 req=TERMINATED/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@654bd1b7(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@4d61769f{s=START}],recv=HttpReceiverOverHTTP@1e0934bd(rsp=IDLE,failure=null)[HttpParser{s=CLOSE,0 of 0}]]]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.badMessage(HttpReceiverOverHTTP.java:285)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1288)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:156)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:117)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:69)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:90)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:112)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:192)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:745)
3. If just access HTTP, namely using url = "" href="http://localhost:8080">http://localhost:8080", the output is 200, which is normal.