无法用Gnus查看论坛的RSS链接

我用GUNS读论坛的订阅链接。感觉好久没收到更新了。看了看发现收取RSS的时候连接服务器失败。别的知乎之类的都能正常收取。

所以特地发帖确认一下。

elpa 镜像好像也有问题,(package-initialize) 一直出错

应该没问题吧:我用 Feedly 订阅了“最新主题”,更新是正常的

https://emacs-china.org/latest.rss

newsbeuter 2.9 订阅,也没问题。

用的的确是这个链接。 改天换个客户端试试。

步骤: 打开Gnus Group Buffer G R输入RSS链接 错误信息如下

Contacting host: emacs-china.org:443
Opening TLS connection to ‘emacs-china.org’...
Opening TLS connection with ‘gnutls-cli --x509cafile nil -p 443 emacs-china.org’...failed
Opening TLS connection with ‘gnutls-cli --x509cafile nil -p 443 emacs-china.org --protocols ssl3’...failed
Opening TLS connection with ‘openssl s_client -connect emacs-china.org:443 -no_ssl2 -ign_eof’...failed
Opening TLS connection to ‘emacs-china.org’...failed
nnrss: Failed to fetch https://emacs-china.org/latest.rss
XML-RPC is not available... not checking Syndic8.
gnus-group-make-rss-group: No feeds found for https://emacs-china.org/latest.rss

我这边试了下没有问题。从你贴出的错误信息大概能看出你的 Emacs 可能无法访问 HTTPS,我不清楚什么原因导致的,我没有在 GNU/Linux 和 Mac 上遇到过这种问题,但我听说 Windows 上可能会遇到这个问题?

用macOS。我觉得可能是gnutls的锅。

翻了一下有看到 git 用 gnutls出问题的,解决方法是改用 openssl 。 http://komamitsu.hatenablog.com/entry/20120619/1340117644

但是之前是可以正常收取的。也许不知道什么时候我装了gnutls之后Emacs改用这个了。

我用 openssl 再试试。

CONNECTED(00000003)
2636:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-64.50.6/src/ssl/s23_clnt.c:593:

后来用 gnutls 测试:

$ gnutls-cli --x509cafile nil -p 443 emacs-china.org                 << [20:36]
Error setting the x509 trust file
Resolving 'emacs-china.org:443'...
Connecting to '116.62.40.117:443'...
- Certificate type: X.509
- Got a certificate list of 2 certificates.
- Certificate[0] info:
 - subject `CN=emacs-china.org', issuer `CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US', serial 0x035ccd2376d86b5ffcbbae72bdc4663464cb, RSA key 2048 bits, signed using RSA-SHA256, activated `2017-03-01 20:37:00 UTC', expires `2017-05-30 20:37:00 UTC', pin-sha256="26zV+xZ4bHLoQg3vEMspWGjxzrNyHe2VjTa5pHu99Ws="
	Public Key ID:
		sha1:1918eab611ddcdda899b5bfa3b2538eb4f333547
		sha256:dbacd5fb16786c72e8420def10cb295868f1ceb3721ded958d36b9a47bbdf56b
	Public Key PIN:
		pin-sha256:26zV+xZ4bHLoQg3vEMspWGjxzrNyHe2VjTa5pHu99Ws=
	Public key's random art:
		+--[ RSA 2048]----+
		|      .          |
		|     o + o       |
		|    o o o o   E  |
		|   . .   * . .   |
		|    +   S.o o .  |
		|   . o  oo...o   |
		|    .   oo=o     |
		|        .=.o     |
		|       .+o+o     |
		+-----------------+

- Certificate[1] info:
 - subject `CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US', issuer `CN=DST Root CA X3,O=Digital Signature Trust Co.', serial 0x0a0141420000015385736a0b85eca708, RSA key 2048 bits, signed using RSA-SHA256, activated `2016-03-17 16:40:46 UTC', expires `2021-03-17 16:40:46 UTC', pin-sha256="YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihg="
- Status: The certificate is NOT trusted. The certificate issuer is unknown. The certificate chain uses insecure algorithm. 
*** PKI verification of server certificate failed...
*** Fatal error: Error in the certificate.
*** handshake has failed: Error in the certificate.

看起来像是无法辨别证书发布者的问题。

 ;; TLS
  (setq tls-program
        '("openssl s_client -connect %h:%p -no_ssl2 -ign_eof"
          "gnutls-cli --x509cafile %t -p %p %h"
          "gnutls-cli -p %p %h"))
;; Default value
;; ("gnutls-cli --x509cafile %t -p %p %h"
;;  "gnutls-cli --x509cafile %t -p %p %h --protocols ssl3"
;;  "openssl s_client -connect %h:%p -no_ssl2 -ign_eof")

最后把 TLS 命令中的证书验证选项去掉就可以了,也就是在配置里面加上以上设置。优先用 openssl 然后备用的是 gnutls。 不过不知道有没有什么副作用。