💾 Archived View for rawtext.club › ~sloum › geminilist › 006382.gmi captured on 2024-02-05 at 11:00:27. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

<-- back to the mailing list

[tech] tls user_canceled issue with Java server + Go client

Gary Johnson lambdatronic at disroot.org

Sun Apr 18 01:04:40 BST 2021

- - - - - - - - - - - - - - - - - - - 

Alan <gemini at bunburya.eu> writes:

When using the Amfora browser, I was unable to view "20" responses,
getting instead the following error: "/Issuing creating page: remote
error: tls: user//canceled/". Unusually, every other response is
displayed fine.

Hi Alan,

I'm the author of Space-Age, a Gemini server written in Clojure.

=

https://gitlab.com/lambdatronic/space-age/

The tls_user_canceled issue you are running into is coming from the Javaside. It also mystified me last year when I was writing my server sinceI was constantly getting that error in elpher (the Emacs Gemini client)whenever I tried to browse pages from my capsule.

You have to force your SSLSocket to send the tls_close_notify alert tothe client before closing the socket. This is exceptionally poorlydocumented in the JSSE Reference Guide, but I eventually figured out thesolution through trial and error.

All you need to do is to make sure you call socket.shutdownOutput()immediately before calling socket.close().

Here's my function for writing a Gemini response back to the client for reference:


This is called from another function that then calls socket.close() toterminate the connection.

Here is my full Gemini server implementation for further reference:

=
> https://gitlab.com/lambdatronic/space-age/-/blob/master/src/space_age/server.clj

Happy hacking!  Gary

-- GPG Key ID: 7BC158EDUse `gpg --search-keys lambdatronic' to find meProtect yourself from surveillance: https://emailselfdefense.fsf.org=======================================================================()  ascii ribbon campaign - against html e-mail/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.See http://www.gnu.org/philosophy/no-word-attachments.html