-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: geminiclient
action: commit
revision:
path_from:
revision_from: fcca572af2ba6f7ed20931ac7e7ccea6cd0e4cc4:
path_to:
revision_to:

git.thebackupbox.net

geminiclient

git://git.thebackupbox.net/geminiclient

commit fcca572af2ba6f7ed20931ac7e7ccea6cd0e4cc4
Author: epoch <epoch@enzo.thebackupbox.net>
Date:   Wed Dec 22 18:34:13 2021 +0000

    updated gemini-get to be able to send client-cert

diff --git a/gemini-get b/gemini-get

index 0d9ac5fbf0cf140e73a9d1c9af1d445c5c004776..

index ..382f5c95db98e27e8c4b1fe76a3813b543df10dc 100755

--- a/gemini-get
+++ b/gemini-get
@@ -1,13 +1,20 @@
-#!/bin/sh
+#!/usr/bin/env bash
+
+#printf "openssl s_client isn't working right. probably libressl version is borked.\n" >&2
+#printf "because of that, we're using ncat --ssl which might break because no SNI.\n" >&2

 if [ ! "$1" ];then
   printf "usage: gemini-get gemini:uri\n"
   printf '   or: gemini-get gemini-proxy:uri\n'
   printf "the output is to stdout and is in raw message/gemini format.\n"
+  printf "any arguments after the first will be passed to openssl s_client.\n"
+  printf "for example, to use a client cert: gemini-get gemini:uri -key ~/epoch.key.pem -cert ~/epoch.cert.pem\n"
   exit 1
 fi

 uri="$1"
+shift
+uri_minus_fragment="$(printf "%s\n" "$uri" | cut '-d#' -f1)"

 scheme="$(printf "%s\n" "$uri" | uricut -s)"

@@ -22,7 +29,7 @@ if [ ! "$port" ];then
   port=1965
 fi

-printf '%s\r\n' "$uri" \
-  | openssl s_client -servername "$host" -quiet -connect "$host":"$port" \
+printf '%s\r\n' "$uri_minus_fragment" \
+  | openssl s_client "$@" -servername "$host" -ign_eof -quiet -connect "$host":"$port" \
  2>/dev/null
 #echo $?

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 16:28:26 2024