Is it possible to Make HTTP/2 requests with Apache HTTPClient 4.2.5? - apache-httpclient-4.x

I'm trying to make an HTTP/2 request with apache client. Is it possible with the below versions?
migrating the versions in my web application cost me heavy code changes. Is there any workaround to support HTTP/2 with TLSv1.3 in httpclient-4.2.5.jar?
Apache libs i'm using:
httpclient-4.2.5.jar
httpcore-4.2.4.jar
httpmime-4.2.5.jar
Thanks in advance.

It looks like HTTP 2 is supported only from version 5. Apache Http Client Status
The main focus of the 5.0 series is providing full-featured support for HTTP/1.1 and HTTP/2 and ensuring full compliance with RFC 7230, RFC 7231, RFC 7540 and RFC 7541.
According to the Apache Http Client News it is still not a stable release of version 5.
However, from Java 11, there is a new Http Client introduced with HTTP 2 support.
It supports HTTP/1.1 and HTTP/2, both synchronous and asynchronous programming models

Related

Error "ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY" in Google Chrome while accessing locally hosted SPA

I've a locally hosted SPA (Kestral/.Net core). It is using a self signed certificate for HTTPS communication (generated through Server Certificates in windows 10).
It works well with IE11, however when accessed from Google Chrome, shows up error - ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY.
Any clues on what could be done to overcome this?
Troubleshooting done so far:
Custom cipher suites order.
Disabling HTTP2 through windows registry.
To use HTTP/2 you must be using TLSv1.2 and cannot use a number of blacklisted, less secure ciphers. This basically means you must use one of the GCM ciphers like TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (though other newer ciphers like TLS_CHACHA20_POLY1305_SHA256 are also support).
If you only have older ciphers configured then Chrome will fallback to HTTP/1.1 or, if that is not available, it will error with that error message.
Adding if it helps anyone digging on same thing, for Kestral setting Protocol Version to http1 looks to be the way to overcome this issue, as Cipher suite doesn't looks to be configurable in kestral at least with .Net core 3.1.

How to downgrade from websocket to http?

I've been reading abit about html5, websockets and http. I made some simple tests but let's say I want to do this:
Browser makes an http connection to a web server
Browser then negotiates a web socket connection to the same web server
At some point browser wants to talk http again with the web server in the same session
Points 1 and 2 are straightforward. Coming to point 3, is there a standard solution available? I'm guessing that closing a web socket by either side terminates the existing connection right? Can there be a way to perform a "downgrade" from websockets back to http?
I guess what I'm looking for is a standards-based solution but if one doesnt exist, do any frameworks exist that can do the job?
Thanks :o)
Nina

Running web socket server on opera 12

I followed the instructions from here to install web socket node.js server on my WXP
I have a client and server written as follows: http://cjihrig.com/blog/creating-your-own-websocket-echo-client/ (ws_server.js)
Please let me know how can I make the web socket connection work...?
When I run the client, Alert displaye are as follows:
1. "Web sockets are supported"
2. "On Close : event / data :Undefined".
So how do i make nodejs work on opera?? It is working fine on google chrome??
I have enabled web sockets in opera config
Thanks
Sneha
The current release version of Opera 12 is
Opera/9.80 (Macintosh; Intel Mac OS X 10.7.4; U; fr) Presto/2.10.289 Version/12.00
as you can see in the user agent string: Presto/2.10.289. The last version of WebSocket Protocol has been implemented in the CORE engine of Opera.
WebSocket API Update WebSocket implementation to RFC 6455
(Presto/2.11.337)
See: The WebSocket API
See: RFC 6455 - The WebSocket Protocol
but as you can see in Presto/2.11.337 which is not yet available in Opera 12. It will be available in a future release.
According to protocol support section Opera uses very old Hixie draft 76. Maybe when you use ws you will have more luck. Furthermore I think you need a project which supports multiple transports(websockets/longpolling etc) like for example faye.js or socket.io

netty websockets hornetq 2.2.5 fails with latest chrome on Sec-WebSocket-Accept header

I am trying to run the netty stomp websockets example in the hornetq 2.2.5 distribution but it does not work with Chrome latest version. Chrome shows the following error in the javascript console -
Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing
Reading on forums seems to suggest that this is related to Netty itself. I understand that chrome is too fast to adapt to the changing websockets protocol so its complaining about a header not being returned from the server.Netty version with the hornetq distro seems to be 3.2.3. If this related to Netty only? Can this be fixed by using a later version of Netty with the same distibution of hornetq?
I think HornetQ is using the older netty websocket package. To support chrome, HornetQ needs to use the new websocketx package.
Both the websocket and websocketx package will be supplied in Netty v3.X for backwards compatibility. Some people have extended the websocket package and have written their own code to support newer versions of the websocket protocol.
In Netty v4, the websocket package has been droped.

Web server for Objective-C

How can I create a webserver from my Obj-C app, and post custom HTML to it?
Thanks!
Check:
SimpleHTTPServer
CocoaHTTPServer
To embed a lightweight HTTP server in iOS or Mac apps, check out GCDWebServer which has a modern and clean architecture designed on top of Grand Central Dispatch.
It would most likely be easier and far more secure to use something like FastCGI and then use an existing HTTP server such as Nginx to serve the HTML that your app passes along rather than trying to embed an HTTP server directly in your application. Plus Nginx is extremely fast and can handle huge server traffic without really breaking a sweat which not all other HTTP servers can say.
Plus using an embedded server means that your app and your HTTP server must run under the same UID which is bad from a security perspective as anyone compromising the HTTP server gains access to all your website files as well.