Estou tentando configurar o Squid-Proxy Server 3.5.26 a partir do squid-cache.org com a configuração SSL-Dump. O uso da abordagem padrão do apt-get para instalar o Squid-Proxy não incluiu os módulos OpenSSL que são necessários. Estou seguindo este guia: Guia de despejo de SSL .
Para compilar o Squid com os módulos do OpenSSL, consultei a documentação e consegui que o Squid fosse compilado e instalado . Para compilar / instalar o Squid, eu também incluí as adições do Debian / Ubuntu perto da parte inferior do guia para definir os locais corretos dos arquivos.
Após a instalação, concluí a seção Init Script , baixando o arquivo init do link fornecido para /etc/init.d/squid
. Em seguida, defina as permissões do arquivo para 755 e atribua a propriedade ao root (isso corresponde aos outros arquivos em init.d
).
Se eu usar o arquivo de configuração padrão do squid /etc/squid/squid.conf
com http_port 3128
, o serviço iniciará bem. No entanto, quando atualizo isso para o seguinte:
http_port 3128 ssl-bump \
cert=/etc/squid/ssl_cert/myCA.pem \
generate-host-certificates=on dynamic_cert_mem_cache_size=4MB
# For squid 3.5.x
sslcrtd_program /usr/local/squid/libexec/ssl_crtd -s /var/lib/ssl_db -M 4MB
acl step1 at_step SslBump1
ssl_bump peek step1
ssl_bump bump all
O serviço do squid não será mais iniciado e /var/log/syslog
conterá o seguinte erro
squid[2062] Squid Parent: (squid-1) Process 2128 started
squid(squid-1) The ssl_crtd helpers are crashing to rapidly, need help!
squid[2062] Squid Parent: (squid-1) Process 2128 exited with status 1
squid[2062] Squid Parent (squid-1) process 2128 will not be restarted due to repeated,
frequent failures.
Qualquer sugestão sobre como eu posso trabalhar com o ssl-dump seria apreciada:)
Atualizar
Encontrou um pouco mais de detalhes sobre o travamento no arquivo cache.log
. Percebi que o ssl_db
não foi inicializado. Mas executando o comando sugerido (mas com caminho relevante do Ubuntu) /lib/squid/ssl_crtd -c -2
returns Can not create directory
.
2017/07/11 14:38:20 kid1| Set Current Directory to /var/cache/squid
2017/07/11 14:38:20 kid1| Starting Squid Cache version 3.5.26 for x86_64-pc-
linux-gnu...
2017/07/11 14:38:20 kid1| Service Name: squid
2017/07/11 14:38:20 kid1| Process ID 2128
2017/07/11 14:38:20 kid1| Process Roles: worker
2017/07/11 14:38:20 kid1| With 65535 file descriptors available
2017/07/11 14:38:20 kid1| Initializing IP Cache...
2017/07/11 14:38:20 kid1| DNS Socket created at [::], FD 6
2017/07/11 14:38:20 kid1| DNS Socket created at 0.0.0.0, FD 7
2017/07/11 14:38:20 kid1| Adding nameserver 192.168.1.254 from
/etc/resolv.conf
2017/07/11 14:38:20 kid1| Adding nameserver 8.8.8.8 from /etc/resolv.conf
2017/07/11 14:38:20 kid1| helperOpenServers: Starting 5/32 'ssl_crtd'
processes
(ssl_crtd): Uninitialized SSL certificate database directory:
/var/lib/ssl_db. To initialize, run "ssl_crtd -c -s /var/lib/ssl_db".
(ssl_crtd): Uninitialized SSL certificate database directory:
/var/lib/ssl_db. To initialize, run "ssl_crtd -c -s /var/lib/ssl_db".
2017/07/11 14:38:20 kid1| Logfile: opening log
daemon:/var/log/squid/access.log
2017/07/11 14:38:20 kid1| Logfile Daemon: opening log
/var/log/squid/access.log
(ssl_crtd): Uninitialized SSL certificate database directory:
/var/lib/ssl_db. To initialize, run "ssl_crtd -c -s /var/lib/ssl_db".
(ssl_crtd): Uninitialized SSL certificate database directory:
/var/lib/ssl_db. To initialize, run "ssl_crtd -c -s /var/lib/ssl_db".
(ssl_crtd): Uninitialized SSL certificate database directory:
/var/lib/ssl_db. To initialize, run "ssl_crtd -c -s /var/lib/ssl_db".
2017/07/11 14:38:20 kid1| Unlinkd pipe opened on FD 25
2017/07/11 14:38:20 kid1| Store logging disabled
2017/07/11 14:38:20 kid1| Swap maxSize 102400 + 262144 KB, estimated 28041
objects
2017/07/11 14:38:20 kid1| Target number of buckets: 1402
2017/07/11 14:38:20 kid1| Using 8192 Store buckets
2017/07/11 14:38:20 kid1| Max Mem size: 262144 KB
2017/07/11 14:38:20 kid1| Max Swap size: 102400 KB
2017/07/11 14:38:20 kid1| Rebuilding storage in /var/cache/squid (clean log)
2017/07/11 14:38:20 kid1| Using Least Load store dir selection
2017/07/11 14:38:20 kid1| Set Current Directory to /var/cache/squid
2017/07/11 14:38:20 kid1| Finished loading MIME types and icons.
2017/07/11 14:38:20 kid1| HTCP Disabled.
2017/07/11 14:38:20 kid1| Squid plugin modules loaded: 0
2017/07/11 14:38:20 kid1| Adaptation support is off.
2017/07/11 14:38:20 kid1| Accepting SSL bumped HTTP Socket connections at
local=[::]:3128 remote=[::] FD 28 flags=9
2017/07/11 14:38:20 kid1| Done reading /var/cache/squid swaplog (0 entries)
2017/07/11 14:38:20 kid1| Store rebuilding is 0.00% complete
2017/07/11 14:38:20 kid1| Finished rebuilding storage from disk.
2017/07/11 14:38:20 kid1| 0 Entries scanned
2017/07/11 14:38:20 kid1| 0 Invalid entries.
2017/07/11 14:38:20 kid1| 0 With invalid flags.
2017/07/11 14:38:20 kid1| 0 Objects loaded.
2017/07/11 14:38:20 kid1| 0 Objects expired.
2017/07/11 14:38:20 kid1| 0 Objects cancelled.
2017/07/11 14:38:20 kid1| 0 Duplicate URLs purged.
2017/07/11 14:38:20 kid1| 0 Swapfile clashes avoided.
2017/07/11 14:38:20 kid1| Took 0.01 seconds ( 0.00 objects/sec).
2017/07/11 14:38:20 kid1| Beginning Validation Procedure
2017/07/11 14:38:20 kid1| Completed Validation Procedure
2017/07/11 14:38:20 kid1| Validated 0 Entries
2017/07/11 14:38:20 kid1| store_swap_size = 0.00 KB
2017/07/11 14:38:20 kid1| WARNING: ssl_crtd #Hlpr1 exited
2017/07/11 14:38:20 kid1| Too few ssl_crtd processes are running (need 1/32)
2017/07/11 14:38:20 kid1| Closing HTTP port [::]:3128
2017/07/11 14:38:20 kid1| storeDirWriteCleanLogs: Starting...
2017/07/11 14:38:20 kid1| Finished. Wrote 0 entries.
2017/07/11 14:38:20 kid1| Took 0.00 seconds ( 0.00 entries/sec).
FATAL: The ssl_crtd helpers are crashing too rapidly, need help!
Squid Cache (Version 3.5.26): Terminated abnormally.
CPU Usage: 0.044 seconds = 0.028 user + 0.016 sys
Maximum Resident Size: 98768 KB
Page faults with physical i/o: 0
2017/07/12 10:32:53| Set Current Directory to /var/cache/squid
Atualização 2
Remover a pasta /var/lib/ssl_db
e, em seguida, executar novamente o /lib/squid/ssl_crtd -c -2
. O log de cache, em seguida, é limpo de erros, mas o serviço ainda não inicia :(.
Atualização 3
Após a reinicialização, o serviço é iniciado corretamente. Vou postar isso como a resposta.