Hi Simone,
2016-02-07 18:43 GMT+08:00 Simone Bordet
<sbordet@xxxxxxxxxxx>:
Hi,
On Fri, Feb 5, 2016 at 6:30 AM, John Jiang <john.sha.jiang@xxxxxxxxx> wrote:
> Hi guys,
> It seems that Jetty HTTP/2 server cannot be connected via its HTTP/1 client
> (org.eclipse.jetty.client.HttpClient).
> The error likes: Illegal character 0x0 in state=START for buffer...
If you get this error, you are not using a HTTP/1.1 client to connect
to the server, but a HTTP/2 client.
The following is my test method,
public void tes() throws Exception, InterruptedException,
ExecutionException, TimeoutException {
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setSslContext(...);
String url = ""> HttpClient client = new HttpClient(sslContextFactory);
client.start();
HttpRequest request = (HttpRequest) client.newRequest(url);
System.out.println(request);
ContentResponse response = request.send();
System.out.println(response.getStatus());
client.stop();
}
I think I'm using HTTP/1.1 client.
> But the HTTP/1 client can access Apache HTTP/2 server.
Apache HTTP/2 server ?
At this point you have to explain what is your setup because it's not clear.
I'm also using an Apache server, which supports HTTP/2 with mod_http2.
On Sat, Feb 6, 2016 at 10:21 AM, John Jiang <john.sha.jiang@xxxxxxxxx> wrote:
> Hi,
>
> 2016-02-05 22:34 GMT+08:00 Jesse McConnell <jesse.mcconnell@xxxxxxxxx>:
>>
>> do you have the http/1 connection configured as well? it needs something
>> to fall back to if http/2 isn't present
>
> I'm using standalone Jetty server with HTTP/2 related modules, and haven't
> any special configuration for HTTP/1.
> I suppose HTTP/1 is supported by default.
>
> When my Jetty server started, I got the below log:
> 2016-02-06 17:16:13.757:INFO:oejs.ServerConnector:main: Started
> ServerConnector@b3d7190{HTTP/1.1,[http/1.1, h2c, h2c-17, h2c-16, h2c-15,
> h2c-14]}{0.0.0.0:9000}
This configuration will be able to accept plain HTTP/1.1 requests, and
HTTP/1.1 upgrade requests to HTTP/2.
> Do I have to configure any more?
You have to explain in more details what you're doing.
You mention clients but not how they are configured, you mention
Jetty, you mention Apache HTTP/2 server...
Difficult to help you out without more detailed information.
--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.