Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPS (proxy) protocol #37

Open
gomggx opened this issue Apr 27, 2019 · 2 comments
Open

HTTPS (proxy) protocol #37

gomggx opened this issue Apr 27, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@gomggx
Copy link

gomggx commented Apr 27, 2019

accesser work for Firefox 66.0.3 (with SwitchyOmega), but not work for chrome 74.0.3724.8 64bit (with SwitchyOmega).
here is the debug message:

D:\Projects\Accesser>python accesser.py
Accesser v0.6.1  Copyright (C) 2018-2019  URenko
2019-04-27 13:14:33 INFO     Accesser.DoH: Selecting DoH server...
2019-04-27 13:14:33 INFO     Accesser: server started at 127.0.0.1:7655
2019-04-27 13:14:38 INFO     Accesser.DoH: Auto selected DoH server: sdns.233py.com
 "ÚÚ������À+À/À,À0̨̩À�À� � � / 5 r: ���� � �ü��'Ýô4��æZç¨Ôe²�BýNª7�²¶ÞÁEAiÏù »��h{¿9L��ûßWk§1uéÊÚ�CÊ[ÁO3på\
2019-04-27 13:14:44 DEBUG    Accesser: ���� � �ü�����ïïòØeR�hôi�üêþ8×�0©U�ç¸�6F� ßp�8aül�D`Kp �(�hYbâ¨ÿ·õ É�òñ "êê������À+À/À,À0̨̩À�À� � � / 5
2019-04-27 13:14:44 DEBUG    Accesser: ���� � �ü���©ýM�iÌ;¼:È�ã�k4�@]!�^ðò��º(T���
R©�Y[��¬«;¼7#8e³�Ñv�GM  ��ªT�Çö�8ãO*Ág��Ó�ø�³ï��:ËtÒä·] "ÊÊ������À+À/À,À0̨̩À�À� � � / 5
2019-04-27 13:14:45 DEBUG    Accesser: ���� � �ü��Âa�õß� ��]çâ}ð��Ú`vi���¥sÌ[b�?2� òñ8ë 6 �ÈÊL'xgÌ¥ñr�?â©�^K2¬`UE¥� "**������À+À/À,À0̨̩À�À� � � / 5
2019-04-27 13:14:47 DEBUG    Accesser: ���� � �ü��ãa�Úý\]�/µÁöü�¼®È²·bc�Õ�ßg±¿D?òý ×g�àò©�ùOI[ÌT~¨¦}�Íß<á��Î ê�ã+ "úú������À+À/À,À0̨̩À�À� � � / 5
qÔ�Bm\Nð��cPJH¨²¼.�ÀX� �<¤ò "cesser: ���� � �ü��e0¢7@ù~y�ÊZ¢vÀB-Rã~Ë'Ë�U��`íc�É| �´Ä
2019-04-27 13:14:54 DEBUG    Accesser: ���� � �ü��N¾Ï1ãËQs`û��䮣h;A²TQ+#�®Ç®�Ðp" ³��Ù�ÁË6°ÐÞNK_t/ð�=°ÈÙD¯B�ÝÌ-.�¼ "
2019-04-27 13:14:56 DEBUG    Accesser: ���� � �ü��lÕÝVÓúÎM�tl^ñð�aäkø�JëøÚ¿+ÆÖ"�Kò ;÷gØÜ�l�ɳ#�RÞ:«.ÎïÊI£h½��9Ú§Fï "ÊÊ������À+À/À,À0̨̩À�À� � � / 5
2019-04-27 13:14:57 WARNING  aioh2: Remote peer sent GOAWAY [ERR: ErrorCodes.NO_ERROR], disconnect now.
2019-04-27 13:15:01 DEBUG    Accesser: ���� � �ü��Æ�,üáøÞS©Ä³�¤â�D��Q  =ªÒ��höâ1�R¹ ��¬��É'ò��!Ûü8T�ÿâFG×ñïújD�ãýÑôP "��������À+À/À,À0̨̩À�À� � � / 5
2019-04-27 13:15:17 DEBUG    Accesser: ���� � �ü���Ñ�n��ÞÓ}"ú�S��ÓZ¢¸×w�T|·���Í�v� ô[g @ôÙ²µ¦X�¡Ï��å¡3Õui¥ª5�§»¶xà"êê������À+À/À,À0̨̩À�À� � � / 5
¬�8�RÖ�Ì "**������À+À/À,À0̨̩À�À� � � / 5 � �ü��j­�
2019-04-27 13:15:19 DEBUG    Accesser: ���� � �ü���{Që¶�ßcÅ�»�âùß­;0ô£�Ü�ª��ëo£8�( !%?lõ[�+î�;~}Ù_Ô¬T�â
2019-04-27 13:15:19 DEBUG    Accesser: ���� � �ü��I��¼�µ¸;_òÆ��\+¯�47}��Ô._�ý�m �Ô��ôh�ªIY�ÆÌ.5aT4Ô�[�Å+9�pj�k "
2019-04-27 13:15:19 DEBUG    Accesser: ���� � �ü��Å®�Fɹ±é iF��¾�k&¸Óe¨ùÐ�ïZ»Ý�� Ü��èn�ë³æ´�ò\É-ýµÖ�oo�j Ä�ï�l "zz������À+À/À,À0̨̩À�À� � � / 5
 *Ä5�/ÙUYå�¢é�îIkÜÌU.ñq�5`��v&Q­esser: ���� � �ü��*1�,&yÀٷΤtuÕÙ��ä�s5C�©�z:©���
2019-04-27 13:15:22 DEBUG    Accesser: ���� � �ü����º�2�c@Þ0Ùe¬�à��o1#˲��j*�ü1¶þ z­�,_@·"����iã���±.È�%Àþ½�µÊ5Ñ ê "êê������À+À/À,À0̨̩À�À� � � / 5
2019-04-27 13:15:22 DEBUG    Accesser: ���� � �ü��ì,�~c�¦[$F¼ú|K�IøÝË&®°} Ä6}µúP�[ ¤kѶ@ÛY÷DçLG¬H@�öÉÖV]Ût�¼Ã¯MÍú|Ï "úú������À+À/À,À0̨̩À�À� � � / 5
2019-04-27 13:15:25 DEBUG    Accesser: ���� � �ü��i�=6:Õ�Üd¤[µdÌûü3À1�ÑQø�z��iøB3 0Ðe�`J�UV�Ò±=�¶\;ÿ�z×�mËC�ñ÷òO "ZZ������À+À/À,À0̨̩À�À� � � / 5
2019-04-27 13:15:25 DEBUG    Accesser: ���� � �ü��r{³��X¶H�q�`�/à¨�7XÏ­¹ôYiÕI� ^jâ ÓSÚ�B¸®¸Çhͨèâ[��³_¢Æ�þ��¥ç¶�R�ñ "ºº������À+À/À,À0̨̩À�À� � � / 5
2019-04-27 13:15:26 DEBUG    Accesser: ���� � �ü���#�ß�¡¦Ûp�A¬�¿�ÌR)µsé-bá�ëX}<fm l��6X*�2�����/��õbêÓ|¯Üöé½,º¸ûá� "
2019-04-27 13:15:26 DEBUG    Accesser: ���� � �ü��G�vGq(ða�Q¢v�Ú8Âåé����DuA¥�F¿IÝ´ pº�ýcWØo%}.SiK��­�©�ßF%~ôð<iÍ4Éø "**������À+À/À,À0̨̩À�À� � � / 5
2019-04-27 13:15:31 DEBUG    Accesser: ���� � �ü���D#/E�¿±yÉ)�a dpT¦¬�S¡öNÒ��hxBV� Á~W�g�Z��a5ÝS¡
2019-04-27 13:15:31 DEBUG    Accesser: ���� � �ü���زÎÖ÷�Pq¡ÈËËpÕ=SÖ�ÿ��VG��
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 50372)
Traceback (most recent call last):
  File "D:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "D:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "D:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\socketserver.py", line 720, in __init__
    self.handle()
  File "accesser.py", line 194, in handle
    if not self.parse_host():
  File "accesser.py", line 103, in parse_host
    command, path = words[:2]
ValueError: not enough values to unpack (expected 2, got 1)
----------------------------------------
2019-04-27 13:15:33 DEBUG    Accesser: ���� � �ü��égz!Ð0YO5¼6���áf�_Pvú�k"�Æ<�Yú¬� Ðù��â���úë:lÜûX�ú£Z�Õ]6?��7�ÓU½´ "
2019-04-27 13:15:37 DEBUG    Accesser: ���� � �ü��Lx=�eWÈeñ�HÆ= Áò1÷VÇF����%\ì×%}© C¹Î��ë*�£�i² DZ¼®gÉ�kæ5üW�ë4K�²� "ªª������À+À/À,À0̨̩À�À� � � / 5
3¾�~ôÐ7�ýyã-_&§rÆO\ máB�ù�|Ì$�òÊÚÓ�¿�jÚã¬núÄ"õ{"c�$ÿ "úú������À+À/À,À0̨̩À�À� � � / 5
@URenko URenko added the bug Something isn't working label Apr 27, 2019
@URenko URenko assigned ghost Apr 27, 2019
@URenko
Copy link
Owner

URenko commented May 27, 2019

so

Solution:

use HTTP as protocol, also for HTTPS.

Technical details:

These garbled characters are the head of HTTPS.

In fact, the HTTP (proxy) protocol will send a CONNECT head first, then start HTTPS handshake (for HTTPS traffic). Most proxy applications use this.
But the HTTPS (proxy) protocol will start HTTPS handshake directly, thus we get the wrong head.

To avoid the problem, we may add auto-detection for these two protocols. But it need some time as we use CONNECT head to detect the remote server now.

@URenko URenko added enhancement New feature or request and removed bug Something isn't working labels May 27, 2019
@URenko URenko changed the title proxy for chrome 74 not work HTTPS (proxy) protocol May 29, 2019
@SeaHOH
Copy link

SeaHOH commented Dec 12, 2019

Two issues in wrap SSLSocket instance:
https://github.com/SeaHOH/extproxy/blob/master/extproxy/ssl_wrap_socket.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants