GithubHelp home page GithubHelp logo

Connect from browsers? about http-2 HOT 3 CLOSED

igrigorik avatar igrigorik commented on July 20, 2024
Connect from browsers?

from http-2.

Comments (3)

igrigorik avatar igrigorik commented on July 20, 2024

Check the chrome://net-internal logs to get more details on the error. Note that the server has to run with TLS (and negotiate h2 or h2-14). Also, Chrome is very strict about security errors.. it won't negotiate h2 if there are certificate errors or if the negotiated ciphers don't match what the h2 specs mandates.

from http-2.

zhenyu-zhou avatar zhenyu-zhou commented on July 20, 2024

Thanks for the quick reply! I find this event at Events tag as you suggested:
t=95776 [st= 0] +REQUEST_ALIVE [dt=14]
t=95776 [st= 0] URL_REQUEST_DELEGATE [dt=0]
t=95776 [st= 0] URL_REQUEST_START_JOB [dt=0]
--> load_flags = 2638848 (BYPASS_DATA_REDUCTION_PROXY | MAIN_FRAME | MAYBE_USER_GESTURE | VERIFY_EV_CERT)
--> method = "GET"
--> priority = "HIGHEST"
--> url = "http://skylynx.cs.duke.edu:8080/"
t=95776 [st= 0] +URL_REQUEST_START_JOB [dt=14]
--> load_flags = 2638848 (BYPASS_DATA_REDUCTION_PROXY | MAIN_FRAME | MAYBE_USER_GESTURE | VERIFY_EV_CERT)
--> method = "GET"
--> priority = "HIGHEST"
--> url = "http://skylynx.cs.duke.edu:8080/"
t=95776 [st= 0] URL_REQUEST_DELEGATE [dt=0]
t=95777 [st= 1] HTTP_CACHE_GET_BACKEND [dt=0]
t=95777 [st= 1] HTTP_CACHE_OPEN_ENTRY [dt=0]
--> net_error = -2 (ERR_FAILED)
t=95777 [st= 1] HTTP_CACHE_CREATE_ENTRY [dt=0]
t=95777 [st= 1] HTTP_CACHE_ADD_TO_ENTRY [dt=0]
t=95777 [st= 1] URL_REQUEST_DELEGATE [dt=0]
t=95777 [st= 1] +HTTP_STREAM_REQUEST [dt=0]
t=95777 [st= 1] HTTP_STREAM_REQUEST_BOUND_TO_JOB
--> source_dependency = 293449 (HTTP_STREAM_JOB)
t=95777 [st= 1] -HTTP_STREAM_REQUEST
t=95778 [st= 2] +HTTP_TRANSACTION_SEND_REQUEST [dt=0]
t=95778 [st= 2] HTTP_TRANSACTION_SEND_REQUEST_HEADERS
--> GET / HTTP/1.1
Host: skylynx.cs.duke.edu:8080
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4
Cookie: [249 bytes were stripped]
t=95778 [st= 2] -HTTP_TRANSACTION_SEND_REQUEST
t=95778 [st= 2] +HTTP_TRANSACTION_READ_HEADERS [dt=4]
t=95778 [st= 2] HTTP_STREAM_PARSER_READ_HEADERS [dt=4]
--> net_error = -324 (ERR_EMPTY_RESPONSE)
t=95782 [st= 6] HTTP_TRANSACTION_RESTART_AFTER_ERROR
--> net_error = -324 (ERR_EMPTY_RESPONSE)
t=95782 [st= 6] -HTTP_TRANSACTION_READ_HEADERS
t=95782 [st= 6] +HTTP_STREAM_REQUEST [dt=1]
t=95783 [st= 7] HTTP_STREAM_REQUEST_BOUND_TO_JOB
--> source_dependency = 293450 (HTTP_STREAM_JOB)
t=95783 [st= 7] -HTTP_STREAM_REQUEST
t=95783 [st= 7] +HTTP_TRANSACTION_SEND_REQUEST [dt=0]
t=95783 [st= 7] HTTP_TRANSACTION_SEND_REQUEST_HEADERS
--> GET / HTTP/1.1
Host: skylynx.cs.duke.edu:8080
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4
Cookie: [249 bytes were stripped]
t=95783 [st= 7] -HTTP_TRANSACTION_SEND_REQUEST
t=95783 [st= 7] +HTTP_TRANSACTION_READ_HEADERS [dt=2]
t=95783 [st= 7] HTTP_STREAM_PARSER_READ_HEADERS [dt=2]
--> net_error = -324 (ERR_EMPTY_RESPONSE)
t=95785 [st= 9] HTTP_TRANSACTION_RESTART_AFTER_ERROR
--> net_error = -324 (ERR_EMPTY_RESPONSE)
t=95785 [st= 9] -HTTP_TRANSACTION_READ_HEADERS
t=95785 [st= 9] +HTTP_STREAM_REQUEST [dt=3]
t=95788 [st=12] HTTP_STREAM_REQUEST_BOUND_TO_JOB
--> source_dependency = 293451 (HTTP_STREAM_JOB)
t=95788 [st=12] -HTTP_STREAM_REQUEST
t=95788 [st=12] +HTTP_TRANSACTION_SEND_REQUEST [dt=0]
t=95788 [st=12] HTTP_TRANSACTION_SEND_REQUEST_HEADERS
--> GET / HTTP/1.1
Host: skylynx.cs.duke.edu:8080
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4
Cookie: [249 bytes were stripped]
t=95788 [st=12] -HTTP_TRANSACTION_SEND_REQUEST
t=95788 [st=12] +HTTP_TRANSACTION_READ_HEADERS [dt=2]
t=95788 [st=12] HTTP_STREAM_PARSER_READ_HEADERS [dt=2]
--> net_error = -324 (ERR_EMPTY_RESPONSE)
t=95790 [st=14] -HTTP_TRANSACTION_READ_HEADERS
--> net_error = -324 (ERR_EMPTY_RESPONSE)
t=95790 [st=14] -URL_REQUEST_START_JOB
--> net_error = -324 (ERR_EMPTY_RESPONSE)
t=95790 [st=14] URL_REQUEST_DELEGATE [dt=0]
t=95790 [st=14] -REQUEST_ALIVE
--> net_error = -324 (ERR_EMPTY_RESPONSE)

The error seems be caused by failing to negotiate handshake and the server sent nothing to the browser. I start the server by simply "ruby server.rb" and the browser with "http://url:8080".

If I load the page by "https://url:8080", the log is different:
t=931004 [st= 0] +REQUEST_ALIVE [dt=32]
t=931004 [st= 0] URL_REQUEST_DELEGATE [dt=0]
t=931004 [st= 0] URL_REQUEST_START_JOB [dt=1]
--> load_flags = 2638849 (BYPASS_DATA_REDUCTION_PROXY | MAIN_FRAME | MAYBE_USER_GESTURE | VALIDATE_CACHE | VERIFY_EV_CERT)
--> method = "GET"
--> priority = "HIGHEST"
--> url = "https://skylynx.cs.duke.edu:8080/"
t=931005 [st= 1] +URL_REQUEST_START_JOB [dt=31]
--> load_flags = 2638849 (BYPASS_DATA_REDUCTION_PROXY | MAIN_FRAME | MAYBE_USER_GESTURE | VALIDATE_CACHE | VERIFY_EV_CERT)
--> method = "GET"
--> priority = "HIGHEST"
--> url = "https://skylynx.cs.duke.edu:8080/"
t=931005 [st= 1] URL_REQUEST_DELEGATE [dt=0]
t=931005 [st= 1] HTTP_CACHE_GET_BACKEND [dt=0]
t=931005 [st= 1] HTTP_CACHE_OPEN_ENTRY [dt=1]
--> net_error = -2 (ERR_FAILED)
t=931006 [st= 2] HTTP_CACHE_CREATE_ENTRY [dt=0]
t=931006 [st= 2] HTTP_CACHE_ADD_TO_ENTRY [dt=0]
t=931006 [st= 2] URL_REQUEST_DELEGATE [dt=0]
t=931006 [st= 2] +HTTP_STREAM_REQUEST [dt=4]
t=931010 [st= 6] SSL_CIPHER_FALLBACK
--> host_and_port = "skylynx.cs.duke.edu:8080"
--> net_error = -100 (ERR_CONNECTION_CLOSED)
t=931010 [st= 6] -HTTP_STREAM_REQUEST
t=931010 [st= 6] +HTTP_STREAM_REQUEST [dt=8]
t=931018 [st=14] SSL_VERSION_FALLBACK
--> TLS 1.2 ==> TLS 1.1
--> host_and_port = "skylynx.cs.duke.edu:8080"
--> net_error = -100 (ERR_CONNECTION_CLOSED)
t=931018 [st=14] -HTTP_STREAM_REQUEST
t=931018 [st=14] +HTTP_STREAM_REQUEST [dt=8]
t=931026 [st=22] SSL_VERSION_FALLBACK
--> TLS 1.1 ==> TLS 1.0
--> host_and_port = "skylynx.cs.duke.edu:8080"
--> net_error = -100 (ERR_CONNECTION_CLOSED)
t=931026 [st=22] -HTTP_STREAM_REQUEST
t=931026 [st=22] HTTP_STREAM_REQUEST [dt=10]
t=931036 [st=32] -URL_REQUEST_START_JOB
--> net_error = -100 (ERR_CONNECTION_CLOSED)
t=931036 [st=32] URL_REQUEST_DELEGATE [dt=0]
t=931036 [st=32] -REQUEST_ALIVE
--> net_error = -100 (ERR_CONNECTION_CLOSED)

But the server still reports "HTTP2::Error::HandshakeError". So any insight to start the server with other options or get more logs from Chrome? (I'm a newbie in chrome log and am sorry if I didn't get the log in a right way.)

from http-2.

igrigorik avatar igrigorik commented on July 20, 2024
  1. Grab the latest code from the repo (3ef03fe)
  2. Run ruby server.rb -s
  3. Open https://localhost:8080 in Chrome; you must have the TLS certificate in your root store, if there is an exception the h2 negotiation will fail.

from http-2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.