<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>38277</bug_id>
          
          <creation_ts>2020-03-25 15:12:59 +0300</creation_ts>
          <short_desc>Проблема запуска apt-get через прокси сервер</short_desc>
          <delta_ts>2025-06-30 09:32:50 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>apt</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="pav@altlinux.org">pav</reporter>
          <assigned_to name="Ivan Zakharyaschev">imz</assigned_to>
          <cc>aen</cc>
    
    <cc>boyarsh</cc>
    
    <cc>cas</cc>
    
    <cc>glebfm</cc>
    
    <cc>imz</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>shevchenkodyu</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>188795</commentid>
    <comment_count>0</comment_count>
    <who name="pav@altlinux.org">pav</who>
    <bug_when>2020-03-25 15:12:59 +0300</bug_when>
    <thetext>Проблема подключения через прокси сервер заключается в некорректном парсинге строк из файла /etc/apt/apt.conf или переменной окружения http_proxy, когда устанавливаемый пароль содержит символ @(0x40)

Предусматривается использование в формате
Acquire::http::Proxy &quot;http://[user[:pass]@]host[:port]/&quot;;

Если в /etc/apt/apt.conf установлены параметры
Acquire::http::proxy &quot;test:P@ssw0rd@10.0.5.213:3128/&quot;;
или установлена переменная http_proxy=http://test:P@ssw0rd@10.0.5.213:3128/
выдается ошибка
# apt-get update
Ошибка http://mirror.yandex.ru p9/branch/x86_64 release
  Could not resolve &apos;ssw0rd@10.0.5.213&apos;
Ошибка http://mirror.yandex.ru p9/branch/x86_64-i586 release
  Could not resolve &apos;ssw0rd@10.0.5.213&apos;

Замена символа @ на %40, также как использование \@, результата не дает.

По аналогии проблема может также касаться записей
Acquire::ftp::Proxy &quot;ftp://[user[:pass]@]host[:port]/&quot;;
Acquire::rsync::proxy=&quot;[user[:pass]@]host[:port]&quot;;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>188799</commentid>
    <comment_count>1</comment_count>
    <who name="pav@altlinux.org">pav</who>
    <bug_when>2020-03-25 16:59:03 +0300</bug_when>
    <thetext>В /etc/apt/apt.conf прописано - 
Acquire::http::proxy &quot;http://test:P@ssw0rd@10.0.5.213:3128/&quot; вместо  &quot;test:P@ssw0rd@10.0.5.213:3128/&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>188800</commentid>
    <comment_count>2</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2020-03-25 17:47:23 +0300</bug_when>
    <thetext>apt/apt-pkg/contrib/strutl.cc +1063</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262727</commentid>
    <comment_count>3</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2025-04-09 15:15:33 +0300</bug_when>
    <thetext>ping</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262732</commentid>
    <comment_count>4</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2025-04-09 15:48:52 +0300</bug_when>
    <thetext>(In reply to Andrey Cherepanov from comment #3)
&gt; ping

проверю и исправлю в ближайшем релизе с HTTPS over http_proxy (хочу сегодня отправить в Sisyphus), спасибо за напоминание!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>263465</commentid>
    <comment_count>5</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2025-04-24 10:32:29 +0300</bug_when>
    <thetext>apt-0.5.15lorg2-alt92 -&gt; sisyphus:

 Wed Apr 16 2025 Ivan Zakharyaschev &lt;imz@altlinux&gt; 0.5.15lorg2-alt92
 - Support encoded usernames and passwords in URIs (incl. http_proxy); it was
   impossible to have @ there; now one should write %40 (ALT#38277).
 - Get config values with percent (%) correct in methods (e.g., a password as
   above in Acquire::http::Proxy). More generally: for correct decoding,
   do always encode percent (%) when %-encoding strings (in any URIs etc).
 - Backported the fixes from Debian 0.9.8~3 (IPv6 literals; encode passwords):
   + properly escape IP-literals (e.g. IPv6 address) in HTTP requests
     (allows using IPv6 numeric addresses in sources.list) (ALT#34000);
   + %-encode username and password when writing URIs (doesn&apos;t help alone with
     reading URIs as in the case of http_proxy above, but normalizes output);
   + include port in shortened URIs (e.g. with apt-cache policy).
 - testcases: Multiplied http-related ones to test these kinds of connections.
 - Some HTTP tweaks from Debian:
   + quote spaces ( ) and plus (+) in filenames (0.9.8~48);
   + do not send keep-alive (HTTP/1.1 default) (0.9.9.3~4^2).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>