derhuerst / gemini

Gemini protocol server & client for Node.js.
ISC License
49 stars 8 forks source link

Missing "servername" option to TLS #10

Closed bwestergard closed 2 years ago

bwestergard commented 2 years ago

In addition to hostname, there should be a servername option in these parameters. This will address the problem noted in this issue report on gemini-fetch.

https://github.com/RangerMauve/gemini-fetch/issues/1

derhuerst commented 2 years ago

Thanks for reporting!

After some half-hearted digging in the Node.js code base, it seems like Node.js does the same with HTTPS requests: Parse the hostname from the URL and use it for SNI. For example, in the Agent implementation:

https://github.com/nodejs/node/blob/2b0087f3d4df741d8031724c9abd2ea71dcc4dab/lib/_http_agent.js#L258-L259

A PR that fixes this is very welcome! This should be where the option needs to be added:

https://github.com/derhuerst/gemini/blob/665fe6b6a49ee6d5f77055af7d89a4edfefc3e47/connect.js#L32-L39

derhuerst commented 2 years ago

Couldn't find a way to get in touch with you personally, so I'll say it here: Thank you for sponsoring me!