summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormauve <ranger@mauve.moe>2020-08-17 20:57:59 -0400
committerJannis Redmann <mail@jannisr.de>2020-08-19 16:34:35 +0200
commit72abf040ac48253399787a60244318c0500b4770 (patch)
tree774ca5dd3bf3baf28cacae47849a636bd36257cf
parent3e66046cf90e566bd3af7a0882078558726d196e (diff)
Fix up protocol issues
-rw-r--r--client.js4
-rw-r--r--connect.js3
2 files changed, 5 insertions, 2 deletions
diff --git a/client.js b/client.js
index e4a3427..4b8bd8d 100644
--- a/client.js
+++ b/client.js
@@ -59,7 +59,7 @@ const _request = (pathOrUrl, opt, cb) => {
})
// send request
- socket.end(encodeURI(pathOrUrl) + ' \r\n')
+ socket.end(pathOrUrl + '\r\n')
})
}
@@ -127,6 +127,7 @@ const sendGeminiRequest = (pathOrUrl, opt, done) => {
letUserConfirmClientCertUsage,
clientCertStore,
tlsOpt,
+ verifyAlpnId,
} = {
followRedirects: false,
// https://gemini.circumlunar.space/docs/spec-spec.txt, 1.4.3
@@ -162,6 +163,7 @@ const sendGeminiRequest = (pathOrUrl, opt, done) => {
hostname: target.hostname || 'localhost',
port: target.port || DEFAULT_PORT,
tlsOpt,
+ verifyAlpnId,
}
let cb = (err, res) => {
diff --git a/connect.js b/connect.js
index d2e8a6e..1c216a5 100644
--- a/connect.js
+++ b/connect.js
@@ -28,7 +28,8 @@ const connectToGeminiServer = (opt, cb) => {
const socket = connectTls({
ALPNProtocols: [ALPN_ID],
minVersion: MIN_TLS_VERSION,
- hostname, port,
+ host: hostname,
+ port,
cert, key, passphrase,
...tlsOpt,
})