From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id 7D9605D5 for ; Sun, 29 Dec 2019 13:42:48 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.69,371,1571695200"; d="scan'208";a="429387414" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 29 Dec 2019 14:42:47 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id 881767F3C5; Sun, 29 Dec 2019 14:42:47 +0100 (CET) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id EBA907ED20 for ; Sun, 29 Dec 2019 14:42:42 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=oliver@first.in-berlin.de; spf=None smtp.mailfrom=oliver@first.in-berlin.de; spf=None smtp.helo=postmaster@einhorn-mail.in-berlin.de IronPort-PHdr: =?us-ascii?q?9a23=3A8VFXcBVyZSUIw5dSqXxXIgJn8cbV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYbBOHt8tkgFKBZ4jH8fUM07OQ7/m7HzZbut3c7DgrS99lb1c9k8?= =?us-ascii?q?IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBo?= =?us-ascii?q?KevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrowjdrNcajIVsJ6o+yhbErWZDdv?= =?us-ascii?q?hLy29vOV+dhQv36N2q/J5k/SRQuvYh+NBFXK7nYak2TqFWASo/PWwt68LlqRfM?= =?us-ascii?q?TQ2U5nsBSWoWiQZHAxLE7B7hQJj8tDbxu/dn1ymbOc32Sq00WSin4qx2RhLklD?= =?us-ascii?q?sLOjgk+2zMlMd+kLxUrw6gpxxnwo7bfoeVNOZlfqjAed8WXHdNU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ii?q?EOXjOik4S5cK+/FLe1x0QY3wgBHZxDbsArlQnbGRAJ0ytK7RjSCoepRNjk3e3a?= =?us-ascii?q?xktGEIB8tCMWr82fxy9g7TAJTP1kCQlqLsdKJZ1iPX8GaFi2aD7hlV?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CeBAB4rAheZBRQxdllHgEbDIF+gicmR?= =?us-ascii?q?iA0ATIqhAiJA4YOnUMJAQMBCgEBIwwBAYRAAoIfHAYGNQUNAhABAQQBAQECAQI?= =?us-ascii?q?DBAEEHAsKBSuFPgyCOykBgnoGI1YQCxoCBSECAg9IBhMaAYMIgnsLqw2BMoQ6A?= =?us-ascii?q?YEUgyqBPYEOKIUdhnwaggCBR4JdPoJkAoRzgl4ErxOBTXF5hjqOWgwbeIFOdoc?= =?us-ascii?q?FhBUsi1WXJJIEAgoHFYFqgXkzGggcFDuCbAlHGA2NHheDUIQgdIVAQAMwkFcBA?= =?us-ascii?q?Q?= X-IPAS-Result: =?us-ascii?q?A0CeBAB4rAheZBRQxdllHgEbDIF+gicmRiA0ATIqhAiJA4Y?= =?us-ascii?q?OnUMJAQMBCgEBIwwBAYRAAoIfHAYGNQUNAhABAQQBAQECAQIDBAEEHAsKBSuFP?= =?us-ascii?q?gyCOykBgnoGI1YQCxoCBSECAg9IBhMaAYMIgnsLqw2BMoQ6AYEUgyqBPYEOKIU?= =?us-ascii?q?dhnwaggCBR4JdPoJkAoRzgl4ErxOBTXF5hjqOWgwbeIFOdocFhBUsi1WXJJIEA?= =?us-ascii?q?goHFYFqgXkzGggcFDuCbAlHGA2NHheDUIQgdIVAQAMwkFcBAQ?= X-IronPort-AV: E=Sophos;i="5.69,371,1571695200"; d="scan'208";a="429387407" X-MGA-submission: =?us-ascii?q?MDG5VOttm4EAgyJ/yxPSUPGCj989kQdwrAFpOr?= =?us-ascii?q?691v56gFusctUQuqjQCH4l89BXebGvn7Z/SaVi7lrxlmER2f70IueY9A?= =?us-ascii?q?Q6DORJVk9pdSj9pBoxgANd2E764tx/aXCFni3gjnvl/oLwy9AmdwfRGK?= =?us-ascii?q?00GxBZhGO8IRa3YQfvCz8Beg=3D=3D?= Received: from einhorn-mail.in-berlin.de ([217.197.80.20]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Dec 2019 14:42:42 +0100 X-Envelope-From: oliver@first.in-berlin.de Received: from authenticated.user (localhost [127.0.0.1]) by einhorn.in-berlin.de with ESMTPSA id xBTDgfJu030043 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 29 Dec 2019 14:42:41 +0100 Date: Sun, 29 Dec 2019 14:42:41 +0100 From: Oliver Bandel To: Alan Schmitt Cc: OCaml Mailing List Message-ID: <20191229134240.censvvrki4xliexz@first.in-berlin.de> References: <87impglc4p.fsf@polytechnique.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87impglc4p.fsf@polytechnique.org> User-Agent: NeoMutt/20180716 Subject: Re: [Caml-list] https and Ocamlnet Reply-To: Oliver Bandel X-Loop: caml-list@inria.fr X-Sequence: 17922 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Quoting Alan Schmitt (snt: 2019-09-25 15:49 +0200 CEST) (rcv: 2019-09-25 15:49 +0200 CEST): > Hello, > > I have a small utility that downloads and parses the RSS feed from > ocaml.org to include in the OCaml Weekly News, but a recent change to > ocaml.org broke it: it seems to only be served through https. I tried to > add a TLS provider, but it's still failing with a cryptic error message. > > Here is an extract of the code showing the problem: > > #+begin_src ocaml > let () = Nettls_gnutls.init() > > let site = "https://ocaml.org" > let feed_name = "/feed.xml" > > let planet = Nethttp_fs.http_fs site > let feedic = planet # read [] feed_name > let feed_string = Netchannels.string_of_in_obj_channel feedic > let () = feedic # close_in() > #+end_src > > I can compile it with > > ocamlfind ocamlc -o test -linkpkg -package netclient,nettls-gnutls test.ml > > but when I run it, I get this error > > Fatal error: exception Nettls_gnutls.TLS.Error(GNUTLS_E_PUSH_ERROR) > > I know nothing of TLS and searching for the error did not point me > toward any solution. > > I'm using gnutls 3.6.9 and ocamlnet 4.1.6. > > How can I access the site using https? > > Thanks, > > Alan Someone else had explored the problem with gnutls and GNUTLS_E_PREMATURE_TERMINATION: Missing "Content-Length" header results in "The TLS connection was non-properly terminated" https://github.com/varnish/hitch/issues/127 Maybe that can help to find a solution here. IMO it's good to have a library throwing an error / raising an exception instead of ignoring it, but as user of that library it should be possible to catch it. Don't know how to catch that exception with ocamlnet's Nettls_gnutls in a convenient way. If someone finds a solution to get the already read data even though the exception was raised by gnutls/ocamlnet, please send it to the list. Ciao, Oliver