Browse Source

Removes the (broken?) test of proper shutdown. Addresses #50

tags/release-1.6
Stephane Bortzmeyer 6 months ago
parent
commit
42c98ba463
  1. 8
      Agunua/__init__.py
  2. 2
      README.md
  3. 4
      agunua

8
Agunua/__init__.py

@ -537,10 +537,12 @@ class GeminiUri():
# 2021-03-03 Not yet mandatory in Gemini
# specification, see
# https://gitlab.com/gemini-specification/protocol/-/issues/2
if self.network_success:
# Anyway, it seems broken https://framagit.org/bortzmeyer/agunua/-/issues/50 so we
# no longer (2021-11-28) do it.
#if self.network_success:
# https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shutdown.html
self.no_shutdown = ((session.get_shutdown() & OpenSSL.SSL.RECEIVED_SHUTDOWN) != \
OpenSSL.SSL.RECEIVED_SHUTDOWN)
#self.no_shutdown = ((session.get_shutdown() & OpenSSL.SSL.RECEIVED_SHUTDOWN) != \
# OpenSSL.SSL.RECEIVED_SHUTDOWN)
break
except (ConnectionRefusedError, TimeoutError) as e: # Or "isinstance(err, (TimeoutError, socket.timeout))" ?
self.error = "%s failed because of \"%s\"" % (addr, e)

2
README.md

@ -89,7 +89,7 @@ won't get a mediatype; etc):
* `lang`: the human language of the resource, as standardized in [BCP 47](https://www.rfc-editor.org/info/bcp47)
* `charset`: actually the encoding of the resource such as UTF-8 or US-ASCII
* `tls_version`: the TLS version, for instance, "TLSv1.3"
* `no_shutdown`: set to True if the server did not properly close the TLS session. It may mean that the content was truncated. Meaningful only with `get_content=True` and if you asked for the whole file.
* `no_shutdown`: [DEPRECATED See https://framagit.org/bortzmeyer/agunua/-/issues/50] set to True if the server did not properly close the TLS session. It may mean that the content was truncated. Meaningful only with `get_content=True` and if you asked for the whole file.
* The rest is related to certificates:
* `issuer`: the CA (Certificate Authority)
* `subject`: the name in the certificate (X.509 calls it "subject")

4
agunua

@ -178,8 +178,8 @@ for url in args:
if u.network_success:
if verbose:
print("Network success with %s." % u.ip_address)
if u.no_shutdown:
print("Warning, no TLS shutdown received from the server", file=sys.stderr)
#if u.no_shutdown:
# print("Warning, no TLS shutdown received from the server", file=sys.stderr)
if tofu != "" and debug:
print("Public key is %s." % u.keystring)
if debug:

Loading…
Cancel
Save