Open bwestergard opened 2 years ago
Okay, I believe I have confirmed my hunch. This library does not do the correct Server Name Indication, but the fix is simple: extract the domain and pass it as a tlsOpt
. Here is a minimal example you can use to reproduce with any Gemini server that supports SNI.
const request = require('@derhuerst/gemini/client')
request('gemini://bjornwestergard.com',
{
tlsOpt: {
rejectUnauthorized: false,
servername: 'bjornwestergard.com', // Without this line, it fails.
},
},
(err, res) => {
if (err) {
console.error(err)
process.exit(1)
}
console.log(res.statusCode, res.statusMessage)
if (res.meta) console.log(res.meta)
res.pipe(process.stdout)
})
This library seems to fail for a great many gemini severs that work fine with browsers like Lagrange and Amfora.
The
gemini://gemini.circumlunar.space
capsule is fetched without issue.But several other sites I've tried consistently fail:
Since I control
bjornwestergard.com
, I can see that theagate
process hosting the site logs the following only when receiving requests from this library:This issue in the
agate
repository suggests to me that this library is perhaps not sending the correct "Server Name Indication".