I found this reddit comment, which states that the problem is Emacs built-in TLS doesn't reject bad certificates. It proposes using external TLS like this:
(if (fboundp 'gnutls-available-p)
NOTE: if you still have issues trying to connect to marmalde repo, it seems to be a different problem. See this github issue.
I had the same problem. Could send mail from home but not at university. I struggle with it for days. I was already using but I was using the port 587. Then changing to port 465 did the job.
So may be you only have to add
(setq smtpmail-stream-type 'ssl)
Make sure you don't have any port number specified in your .authinfo file, it might override the ...
Your question is similar to the old one accessing MELPA/ELPA sites, also https - so there are two possible solutions to solve that:
Upgrade to emacs version 26.3, this is solved there; - but seems to need more work as revealed by @npostavs.
If you still need version 26.2, then add to your custom file the following:
After much digging, I believe a common cause of this is likely a combination of two things:
elpa.gnu.org is misconfigured, sending its own certificate in duplicate before the issuer certificate - this counts as an out-of-order certificate problem. This can be confirmed using gnutls-cli or openssl s_client. I have notified the maintainer.
A lack of ...
I tried gnutls-cli hostname -p 9001 to check if there actually was a problem with the cert (and not just my Emacs 25) and it turns out the certificate was expired. So it seems Emacs 24 didn't care about expiry (nor did the weechat android app). Redoing http://www.weechat.org/files/doc/stable/weechat_user.en.html#relay_ssl (and updating my ~/.emacs.d/weechat-...