Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Is this TERMINAL fun?


dovenet / Synchronet Javascript / Suppressing HTTPRequest TLS Errors

SubjectAuthor
* Suppressing HTTPRequest TLS ErrorsCodefenix
`* Suppressing HTTPRequest TLS ErrorsDigital Man
 `- Suppressing HTTPRequest TLS ErrorsCodefenix

1
Suppressing HTTPRequest TLS Errors

<623DDE24.607.dove-net2012@conchaos.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=743&group=DOVE-Net.Synchronet_Javascript#743

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: codefenix@VERT/CONCHAOS (Codefenix)
To: All
Subject: Suppressing HTTPRequest TLS Errors
Message-ID: <623DDE24.607.dove-net2012@conchaos.synchro.net>
Date: Fri, 25 Mar 2022 04:22:12 -0400
X-Comment-To: All
Path: rocksolidbbs.com!not-for-mail
Organization: ConstructiveChaos BBS
Newsgroups: DOVE-Net.Synchronet_Javascript
X-FTN-PID: Synchronet 3.18b-Win32 Sep 20 2020 MSC 1927
X-FTN-CHRS: CP437 2
WhenImported: 20220325082228-0700 c1e0
WhenExported: 20220325115754-0700 c1e0
ExportedFrom: VERT sync-js 3658
WhenImported: 20220325112212-0400 c12c
WhenExported: 20220325112226-0400 c12c
ExportedFrom: CONCHAOS dove-net2012 607
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Codefenix - Fri, 25 Mar 2022 08:22 UTC

Some backround info for context..

I'm writing a simple weather forecast reader in JS which makes use of multiple
APIs for determining location data and then forecast data based on that location.

For US cities, the weather.gov API takes a specified latitude and longitude as URL parameters, and gives you a forecast URL for that area. Since the average person walking around typically doesn't have latitude and longitude coordinates commited to memory, I decided to use another API, geocode.maps.co, to return the latitude and longitude for a specified city.

I have all of this working. However whenever I make the HTTPRequest call to geocode.maps.co, SBBS logs TLS errors to error.log like this one:

term 33736 TLS ERROR 'No data was read because the remote system closed the connection (recv() == 0)' (-1) popping data

This happens on *successful* HTTPRequest calls to this API. The HTTPRequest is getting the response from the API containing the json data for the specified input, but it's logging a TLS error at the same time. The calls are placed in a try/catch block, but the catch does not get hit in this scenario.

To the user, it appears nothing is wrong whatsoever. But to me, I see TLS errors logged every time someone uses the functionality to query location data. None of the other APIs I'm using are leading to this outcome; just this one.

Which leads me to my question: is there a way I can suppress those TLS errors, or am I stuck with them cluttering the error.log file?

---
■ Synchronet ■ -=[ conchaos.synchro.net | ConstructiveChaos BBS ]=-

Suppressing HTTPRequest TLS Errors

<623E1881.3662.sync-js@vert.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=747&group=DOVE-Net.Synchronet_Javascript#747

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: digital.man@VERT (Digital Man)
To: Codefenix
Subject: Suppressing HTTPRequest TLS Errors
Message-ID: <623E1881.3662.sync-js@vert.synchro.net>
Date: Fri, 25 Mar 2022 05:31:13 -0700
X-Comment-To: Codefenix
Path: rocksolidbbs.com!not-for-mail
Organization: Vertrauen
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <623DDE24.607.dove-net2012@conchaos.synchro.net>
References: <623DDE24.607.dove-net2012@conchaos.synchro.net>
X-FTN-PID: Synchronet 3.19c-Win32 master/9ac7335f3 Mar 25 2022 MSC 1929
X-FTN-CHRS: CP437 2
WhenImported: 20220325123113-0700 c1e0
WhenExported: 20220325175752-0700 c1e0
ExportedFrom: VERT sync-js 3662
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Digital Man - Fri, 25 Mar 2022 12:31 UTC

Re: Suppressing HTTPRequest TLS Errors
By: Codefenix to All on Fri Mar 25 2022 11:22 am

> Some backround info for context..
>
> I'm writing a simple weather forecast reader in JS which makes use of
> multiple APIs for determining location data and then forecast data based on
> that location.
>
> For US cities, the weather.gov API takes a specified latitude and longitude
> as URL parameters, and gives you a forecast URL for that area. Since the
> average person walking around typically doesn't have latitude and longitude
> coordinates commited to memory, I decided to use another API,
> geocode.maps.co, to return the latitude and longitude for a specified city.
>
> I have all of this working. However whenever I make the HTTPRequest call to
> geocode.maps.co, SBBS logs TLS errors to error.log like this one:
>
> term 33736 TLS ERROR 'No data was read because the remote system closed the
> connection (recv() == 0)' (-1) popping data
>
> This happens on *successful* HTTPRequest calls to this API. The HTTPRequest
> is getting the response from the API containing the json data for the
> specified input, but it's logging a TLS error at the same time. The calls
> are placed in a try/catch block, but the catch does not get hit in this
> scenario.

Yeah, the Socket object doesn't throw JS exceptions. It probably should (rather than directly log errors).

There's likely something that the http.js should be doing but isn't, to avoid that error. It's not something I've played with much. I'd see if you can catch deuce on irc.synchro.net #synchronet.

I could probably do the throwing-exceptions change myself, but the actual "fix" might just be a change to http.js.

> To the user, it appears nothing is wrong whatsoever. But to me, I see TLS
> errors logged every time someone uses the functionality to query location
> data. None of the other APIs I'm using are leading to this outcome; just
> this one.
>
> Which leads me to my question: is there a way I can suppress those TLS
> errors, or am I stuck with them cluttering the error.log file?

For the moment, yeah, but I'm sure there's a solution.
--
digital man (rob)

This Is Spinal Tap quote #26:
David St. Hubbins: They were still booing him when we came on stage.
Norco, CA WX: 81.9°F, 28.0% humidity, 5 mph ESE wind, 0.00 inches rain/24hrs
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net

Suppressing HTTPRequest TLS Errors

<623E3019.612.dove-net2012@conchaos.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=750&group=DOVE-Net.Synchronet_Javascript#750

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: codefenix@VERT/CONCHAOS (Codefenix)
To: Digital Man
Subject: Suppressing HTTPRequest TLS Errors
Message-ID: <623E3019.612.dove-net2012@conchaos.synchro.net>
Date: Fri, 25 Mar 2022 10:11:53 -0400
X-Comment-To: Digital Man
Path: rocksolidbbs.com!not-for-mail
Organization: ConstructiveChaos BBS
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <623E1881.3662.sync-js@vert.synchro.net>
References: <623E1881.3662.sync-js@vert.synchro.net>
X-FTN-PID: Synchronet 3.18b-Win32 Sep 20 2020 MSC 1927
X-FTN-CHRS: CP437 2
WhenImported: 20220325141600-0700 c1e0
WhenExported: 20220325175752-0700 c1e0
ExportedFrom: VERT sync-js 3665
WhenImported: 20220325171153-0400 c12c
WhenExported: 20220325171554-0400 c12c
ExportedFrom: CONCHAOS dove-net2012 612
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Codefenix - Fri, 25 Mar 2022 14:11 UTC

Re: Suppressing HTTPRequest TLS Errors
By: Digital Man to Codefenix on Fri Mar 25 2022 12:31 pm

DM> For the moment, yeah, but I'm sure there's a solution.

OK, thanks for the reply. I'll live with it for now. :)

---
■ Synchronet ■ -=[ conchaos.synchro.net | ConstructiveChaos BBS ]=-

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor