-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http2.connect doesn't connect to an http2 secure server #14671
Comments
You need to pass in tls options to the http2.connect('https://localhost:1234', { rejectUnauthorized: false, ca: fs.readFileSync('ca.pem') }); |
@chiptus ... can you confirm that you're still having an issue after passing in the TSL options on the connect? |
this is not working. is should these options be documented? |
Where is this documented? Not in the 8.x docs afaict... And regardless, why is a certificate necessary for the client? I get the point of providing a list of trusted certificates, so that untrusted servers can be rejected (otherwise https is kind of pointless), but that's a different story. I have trouble using the example from the docs modified against an HTTP/2 test server, the const http2 = require('http2');
const client = http2.connect('https://httpbin.org');
const req = client.request({':path': '/ip'}, {endStream: true});
req.on('response', (headers) => {
console.log(headers[':status']);
}); This is in 8.4, 8.5, 8.6 and 8.7-rc.2 Might be related to #15405 |
@grantila httpbin doesn't work for http2. Use |
That's interesting... Any ideas on why? And why no error? Only a |
Why doesn't httpbin support http2? I don't know, I don't run the service... if I had to guess, it probably hasn't been updated in ages. I'll leave it to someone else to answer why the code doesn't throw and whether it even should. The |
Boy do I feel stupid mixing up "httpbin" with "httpbis" (http/2) believing httpbin.org was actually serving h2... But it does show the need for a generic way to fetch from "https://somewhere" without having to know what that server runs, as explained in #16256. I tried @chiptus code and added |
@grantila Glad to hear it worked and yea, we definitely need to continue work on the client-side of h2. It currently doesn't support downgrading to h1, doesn't support the whole Agent model, etc. @chiptus Is this still an issue you're experiencing? If not or we don't hear back, we'll probably close this up in the next few days (but feel free to re-open). |
I actually didn't check it since then. I will try to have a look
…On Wed, Oct 18, 2017 at 10:19 AM, Anatoli Papirovski < ***@***.***> wrote:
@grantila <https://github.com/grantila> Glad to hear it worked and yea,
we definitely need to continue work on the client-side of h2. It currently
doesn't support downgrading to h1, doesn't support the whole Agent model,
etc.
@chiptus <https://github.com/chiptus> Is this still an issue you're
experiencing? If not or we don't hear back, we'll probably close this up in
the next few days (but feel free to re-open).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14671 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABUVF0d3ICxssCgpKH-UrGQiimIQMEjcks5sthbwgaJpZM4Ovtdh>
.
|
As there hasn't been much activity on this, everyone else seems to be able to |
Using the code examples from james's post
Chrome is connecting to the server successfully, but the client doesn't. Before changing the server to secure server it was the opposite way.
server.js
client.js
#goodnessSquad
The text was updated successfully, but these errors were encountered: