Bermut
@Bermut
Жертва домашней лаборатории

Почему возникает ошибка 111 в squid?

Разбираюсь с squid, настроил прозрачный http(s) прокси, но он не работает, по https отвечает невалидным сертификатом (при этом он добавлен в доверенные), если игнорировать эту ошибку, то отвечает подобной страницей (что по http, что по https, одна и та же картина)
spoiler
63239b70a5360873369962.jpeg

В access.log при заходе на любую страницу пишет:
1663278068.155      1 (ip адрес клиента) TCP_MISS/503 4395 GET http://domain/ - ORIGINAL_DST/(ip адрес прокси сервера) text/html
1663278068.214      0 (ip адрес клиента) TCP_HIT/200 13048 GET http://proxy:3128/squid-internal-static/icons/SN.png - HIER_NONE/- image/png
1663278068.254      0 (ip адрес клиента) TCP_MISS/503 4298 GET http://domain/favicon.ico - ORIGINAL_DST/(ip адрес прокси сервера) text/html


Конфиг
http_access allow all
http_port 3128
http_port 3129 intercept
https_port 3130 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid/ssl/squid.pem key=/etc/squid/ssl/squid.key
sslproxy_cert_error allow all
sslproxy_flags DONT_VERIFY_PEER
always_direct allow all
ssl_bump server-first all
ssl_bump none all
sslcrtd_program /usr/lib/squid/security_file_certgen -s /var/lib/ssl_db -M 4MB


acl localnet src 10.0.0.0/8		# RFC 1918 local private network (LAN)

acl SSL_ports port 443
acl Safe_ports port 80		# http
acl Safe_ports port 443		# https

#http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
#http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
#http_access allow localhost manager
#http_access deny manager

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet
#http_access allow localhost

# And finally deny all other access to this proxy
#http_access deny all

# Squid normally listens to port 3128
#http_port 3128

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:		1440	20%	10080
refresh_pattern ^gopher:	1440	0%	1440
refresh_pattern -i (/cgi-bin/|\?) 0	0%	0
refresh_pattern .		0	20%	4320

squid -v
Squid Cache: Version 5.7
Service Name: squid

This binary uses OpenSSL 1.1.1n  15 Mar 2022. For legal restrictions on distribution see https://www.openssl.org/source/license.html

configure options:  '--with-build-environment=default' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--libexecdir=/usr/lib/squid' '--mandir=/usr/share/man' '--enable-inline' '--disable-arch-native' '--enable-async-io=8' '--enable-storeio=ufs,aufs,diskd,rock' '--enable-removal-policies=lru,heap' '--enable-delay-pools' '--enable-cache-digests' '--enable-icap-client' '--enable-follow-x-forwarded-for' '--enable-auth-basic=DB,fake,getpwnam,LDAP,NCSA,NIS,PAM,POP3,RADIUS,SASL' '--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos,wrapper' '--enable-auth-ntlm=fake,SMB_LM' '--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,unix_group,wbinfo_group' '--enable-security-cert-validators=fake' '--enable-storeid-rewrite-helpers=file' '--enable-url-rewrite-helpers=fake' '--enable-eui' '--enable-esi' '--enable-icmp' '--enable-zph-qos' '--enable-ecap' '--disable-translation' '--with-swapdir=/var/spool/squid' '--with-logdir=/var/log/squid' '--with-pidfile=/run/squid.pid' '--with-filedescriptors=65536' '--with-large-files' '--with-default-user=proxy' '--enable-ssl' '--enable-ssl-crtd' '--with-openssl'

В чем может быть проблема?
  • Вопрос задан
  • 90 просмотров
Пригласить эксперта
Ответы на вопрос 2
ValdikSS
@ValdikSS
https_proxy это Secure Web Proxy (http-прокси поверх TLS), а не прокси для https-трафика.
Ответ написан
Комментировать
@AUser0
Чем больше знаю, тем лучше понимаю, как мало знаю.
Хммм, странно. Вот это
Connection to (ip адрес прокси сервера) failed.
выглядит странно. Получается Squid коннектится к самому себе, и ему это не удаётся, о чём он и сообщает этой страницей. В логах ORIGINAL_DST говорит об этом-же.

То есть клиент запрашивает не IP-адрес сайта "http://домен/", а IP-адрес самого Squid. Копайте в эту сторону. Проверяйте, какой IP для "http://домен/" видит сам клиент, однако (через nslookup, или через ping).

P.S. Можно на сервере со Squid поднять простейший HTTP с одной тестовой страницей - и обращение на любой домен будет выдавать эту тестовую страницу, потому что Squid обращается сам к себе...
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы