bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53941: 27.2; socks + tor dont work with https


From: J.P.
Subject: bug#53941: 27.2; socks + tor dont work with https
Date: Thu, 10 Mar 2022 00:58:42 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

v5. Forgot to account for look-up failures (shocking not shocking).
Also removed hard-coded port numbers from tests.

The EWW example from earlier needs some adapting:

  ;; M-x eww RET https://check.torproject.org RET

  (require 'socks)
  (require 'gnutls)
  (require 'nsm)

  (defun my-socks-open-https (name buffer host service &rest params)
    (let ((proc (apply #'socks-open-network-stream-legacy
                       name buffer host service params)))
      (advice-add 'network-lookup-address-info :override #'socks-tor-resolve)
      (unwind-protect
          (when (eq service 443)
            (gnutls-negotiate :process proc :hostname host)
            (unless (string-suffix-p ".onion" host)
              (nsm-verify-connection proc host service)))
        (advice-remove 'network-lookup-address-info #'socks-tor-resolve))
      proc))

  (setq socks-server '("tor" "127.0.0.1" 9050 5)
        socks-username ""
        socks-password ""
        url-gateway-method 'socks
        socks-open-network-stream-function #'my-socks-open-https)

Let me know if you need help. Thanks.

Attachment: 0000-NOT-A-PATCH-v4-v5.diff
Description: Text Data

Attachment: 0001-Simplify-network-stream-opener-in-socks.el.patch
Description: Text Data

Attachment: 0002-lisp-url-url-gw.el-url-open-stream-Honor-socks-gatew.patch
Description: Text Data

Attachment: 0003-Fix-string-encoding-bug-in-socks-tests.patch
Description: Text Data

Attachment: 0004-Add-support-for-SOCKS-4a.patch
Description: Text Data

Attachment: 0005-Support-SOCKS-resolve-extension.patch
Description: Text Data

Attachment: 0006-POC-Demo-SOCKS-resolve-with-HTTPS.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]