Subject: bug#33780: network-stream.el: network-stream-certificate always returns nil

From: Robert Pluim <[email-masked]>
Date: Mon, 14 Jan 2019 17:25:55 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Robert Pluim <[email-masked]>
>> Cc: [email-masked],  [email-masked],  [email-masked]
>> Date: Mon, 14 Jan 2019 14:27:15 +0100
>> 
>> Fixed. I was about to push, then got paranoid, so I wrote a few tests
>> for 'open-network-stream', which gave me a few suprises. I had to add
>> the following in network-stream-tests.el:
>> 
>> +(require 'network-stream)
>> +; The require above is needed for 'open-network-stream', but it pulls
>> +; in nsm, which then makes the :nowait tests fail unless we disable
>> +; the nsm.
>> +(setq network-security-level 'low)
>> 
>> otherwise both the old and my new ':nowait t' tests failed. Is that
>> expected?
>
> Not sure.  Did you understand why it failed?  IOW, what does nsm have
> to do with the failures?

When I ran the equivalent 'open-network-stream' code to the tests
manually in 'emacs -Q', I get a prompt from nsm asking me whether to
accept the certificate of the server Iʼm connecting to.

When running the test suite, weʼre in batch mode, so thereʼs no way to
answer that question, as far as I know, so turning off the nsm is the
only way to go.

This only fails for the existing tests with ':nowait t', since then I
suspect nsm gets called automatically, whilst in the ':nowait nil'
case nsm never gets called (the existing tests all use
'make-network-process' directly, rather than 'open-network-stream', so
they bypass nsm).

This could be seen as a bug in nsm, I suppose, since naïvely you
wouldn't expect loading it to change the behaviour of
'make-network-process'.

Robert